From ce7090001d104fb43afacfd64e48d182b0ff8761 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 18 Sep 2019 12:54:37 +0000 Subject: [PATCH] [FIX] product: Field display_name in product template form view Steps to reproduce the bug: - Go to Sales app and open the form view of a product P - With studio add the field display_name in the view - Try to create a new product Bug: A access error was raised because a read was made on a record in cache opw:2070074 closes odoo/odoo#37133 X-original-commit: 90143c18f50ff31ded5aba7d7ba3beb66423ff06 Signed-off-by: Simon Goffin (sig) --- addons/product/models/product_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index c5a7aab49b8..a70700fea72 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -400,7 +400,7 @@ class ProductTemplate(models.Model): @api.multi def name_get(self): # Prefetch the fields used by the `name_get`, so `browse` doesn't fetch other fields - self.read(['name', 'default_code']) + self.browse(self.ids).read(['name', 'default_code']) return [(template.id, '%s%s' % (template.default_code and '[%s] ' % template.default_code or '', template.name)) for template in self]