Skip to content
Snippets Groups Projects
Commit ce709000 authored by Goffin Simon's avatar Goffin Simon Committed by fw-bot
Browse files

[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: 90143c18
Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
parent 88889b6a
No related branches found
No related tags found
No related merge requests found
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment