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.

18 lines
503 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 odoo import models, fields, api
  5. class ProductProduct(models.Model):
  6. _inherit = 'product.product'
  7. @api.multi
  8. @api.depends('image')
  9. def _compute_has_image(self):
  10. for product in self:
  11. product.has_image = product.image is not False
  12. has_image = fields.Boolean(
  13. compute='_compute_has_image', string='Has Image', store=True)