From 8701ea69e1b1b9e4f1d4f6bac6ae82bac211ea41 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 18 Apr 2017 12:27:32 +0200 Subject: [PATCH] [FIX] import and error in product code --- pos_default_empty_image/__init__.py | 1 + pos_default_empty_image/product.py | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pos_default_empty_image/__init__.py b/pos_default_empty_image/__init__.py index e69de29b..9649db77 100644 --- a/pos_default_empty_image/__init__.py +++ b/pos_default_empty_image/__init__.py @@ -0,0 +1 @@ +from . import product diff --git a/pos_default_empty_image/product.py b/pos_default_empty_image/product.py index 44c1d09c..4515795a 100644 --- a/pos_default_empty_image/product.py +++ b/pos_default_empty_image/product.py @@ -5,16 +5,13 @@ from openerp import models, fields, api -class ProductTemplate(models.Model): - _inherit = ['product.template'] +class ProductProduct(models.Model): + _inherit = 'product.product' @api.multi - @api.depends('field.image') - def _has_image(self): + @api.depends('image') + def _compute_has_image(self): for record in self: record.has_image = bool(record.image) - has_image = fields.Boolean( - compute='_has_image', - store=True, - readonly=True) + has_image = fields.Boolean(compute='_compute_has_image', store=True)