diff --git a/pos_default_empty_image/README.rst b/pos_default_empty_image/README.rst index abe091b5..2e276d87 100644 --- a/pos_default_empty_image/README.rst +++ b/pos_default_empty_image/README.rst @@ -64,6 +64,7 @@ Contributors * Hparfr `Akretion `_ * Sylvain LE GAL +* Ronald Portier See also this module `pos_improve_images from GRAP `_ for OpenERP 7. diff --git a/pos_default_empty_image/__init__.py b/pos_default_empty_image/__init__.py index e69de29b..9dd1c5c2 100644 --- a/pos_default_empty_image/__init__.py +++ b/pos_default_empty_image/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import models diff --git a/pos_default_empty_image/__openerp__.py b/pos_default_empty_image/__openerp__.py index b0fa5408..b7b3c809 100644 --- a/pos_default_empty_image/__openerp__.py +++ b/pos_default_empty_image/__openerp__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'POS Default empty image', - 'version': '8.0.0.1.0', + 'version': '8.0.0.1.1', 'category': 'Point Of Sale', 'summary': 'Optimise load time for products with no image', 'author': "Akretion, GRAP, Odoo Community Association (OCA)", diff --git a/pos_default_empty_image/models/__init__.py b/pos_default_empty_image/models/__init__.py new file mode 100644 index 00000000..550fd31c --- /dev/null +++ b/pos_default_empty_image/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import product_product diff --git a/pos_default_empty_image/product.py b/pos_default_empty_image/models/product_product.py similarity index 53% rename from pos_default_empty_image/product.py rename to pos_default_empty_image/models/product_product.py index 44c1d09c..f39548fe 100644 --- a/pos_default_empty_image/product.py +++ b/pos_default_empty_image/models/product_product.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- # © <2015> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openerp import api, fields, models -from openerp import models, fields, api - -class ProductTemplate(models.Model): - _inherit = ['product.template'] +class ProductProduct(models.Model): + _inherit = ['product.product'] @api.multi - @api.depends('field.image') - def _has_image(self): + @api.depends('image') + def _compute_has_image(self): for record in self: record.has_image = bool(record.image) has_image = fields.Boolean( - compute='_has_image', + compute='_compute_has_image', store=True, - readonly=True) + readonly=True, + )