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
594 B

  1. # Copyright (C) 2017 - Today:
  2. # GRAP (http://www.grap.coop)
  3. # Akretion (http://www.akretion.com)
  4. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  5. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  6. from odoo import models, fields, api
  7. class ProductProduct(models.Model):
  8. _inherit = 'product.product'
  9. @api.multi
  10. @api.depends('image')
  11. def _compute_has_image(self):
  12. for product in self:
  13. product.has_image = product.image
  14. has_image = fields.Boolean(
  15. compute='_compute_has_image', string='Has Image', store=True)