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.

16 lines
437 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 ProductTemplate(models.Model):
  6. _inherit = 'product.template'
  7. @api.multi
  8. def _get_has_image(self):
  9. self.ensure_one()
  10. self.has_image = self.image is not False
  11. has_image = fields.Boolean(compute='_get_has_image', string='Has Image')