Browse Source

[FIX] fix product.py

pull/153/head
Invitu 8 years ago
parent
commit
8eee14fff4
  1. 13
      pos_default_empty_image/product.py

13
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')
Loading…
Cancel
Save