You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
514 B

  1. # -*- coding: utf-8 -*-
  2. # © <2015> <Akretion, GRAP, OCA>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp import api, fields, models
  5. class ProductProduct(models.Model):
  6. _inherit = ['product.product']
  7. @api.multi
  8. @api.depends('image')
  9. def _compute_has_image(self):
  10. for record in self:
  11. record.has_image = bool(record.image)
  12. has_image = fields.Boolean(
  13. compute='_compute_has_image',
  14. store=True,
  15. readonly=True,
  16. )