Browse Source

[FIX] Pylint on pos_remove_pos_category

pull/147/head
Carlos Vásquez 7 years ago
parent
commit
656ab55d96
  1. 22
      pos_remove_pos_category/__openerp__.py
  2. 11
      pos_remove_pos_category/product.py

22
pos_remove_pos_category/__openerp__.py

@ -1,23 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015-TODAY Akretion (<http://www.akretion.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2016 Akretion (<http://www.akretion.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# -*- encoding: utf-8 -*-
{
'name': 'POS Remove POS Category',

11
pos_remove_pos_category/product.py

@ -46,8 +46,8 @@ class ProductCategory(models.Model):
image = fields.Binary(help='Show Image Category in Form View')
image_medium = fields.Binary(help='Show image category button in POS',
compute="_get_image",
inverse="_set_image",
compute="_compute_get_image",
inverse="_inverse_set_image",
store=True)
available_in_pos = fields.Boolean(
string="Available in the Point of Sale",
@ -57,13 +57,14 @@ class ProductCategory(models.Model):
"whatever their checkbox state.")
@api.multi
def _get_image(self):
def _compute_get_image(self):
return dict(
(rec.id, tools.image_get_resized_images(rec.image)) for rec in
self)
@api.one
def _set_image(self):
@api.multi
def _inverse_set_image(self):
self.ensure_one()
return self.write(
{'image': tools.image_resize_image_big(self.image_medium)})

Loading…
Cancel
Save