diff --git a/pos_remove_pos_category/__openerp__.py b/pos_remove_pos_category/__openerp__.py index 3c1592e6..faad5315 100644 --- a/pos_remove_pos_category/__openerp__.py +++ b/pos_remove_pos_category/__openerp__.py @@ -1,23 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2015-TODAY Akretion (). -# -# 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 . -# -############################################################################## +# © 2016 Akretion (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# -*- encoding: utf-8 -*- { 'name': 'POS Remove POS Category', diff --git a/pos_remove_pos_category/product.py b/pos_remove_pos_category/product.py index d4fcf4bc..1396912a 100644 --- a/pos_remove_pos_category/product.py +++ b/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)})