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.
 
 
 
 

21 lines
526 B

# -*- coding: utf-8 -*-
# © <2015> <Akretion, OCA>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class ProductTemplate(models.Model):
_inherit = ['product.template']
_name = 'product.template'
@api.multi
@api.depends('field.image')
def _has_image(self):
for record in self:
record.has_image = bool(record.image)
has_image = fields.Boolean(
compute='_has_image',
store=True,
readonly=True)