diff --git a/pos_default_empty_image/product.py b/pos_default_empty_image/product.py index 44c1d09c..ad3d5ffd 100644 --- a/pos_default_empty_image/product.py +++ b/pos_default_empty_image/product.py @@ -8,13 +8,8 @@ from openerp import models, fields, api class ProductTemplate(models.Model): _inherit = ['product.template'] - @api.multi - @api.depends('field.image') - def _has_image(self): - for record in self: - record.has_image = bool(record.image) + @api.one + def _get_has_image(self): + self.has_image = self.image is not False - has_image = fields.Boolean( - compute='_has_image', - store=True, - readonly=True) + has_image = fields.Boolean(compute='_get_has_image', string='Has Image')