[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) <sig@openerp.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user