product.name_get() ignores _rec_name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
In Progress
|
Low
|
OpenERP R&D Addons Team 2 |
Bug Description
OpenERP 7.0 nightly build: 20130410-232405
Description:
The name_get() orm method redefined by product.product (product/
if sellers:
for s in sellers:
mydict = {
}
else:
mydict = {
'id': product.id,
}
It should instead call to super().name_get() or at least manage the _rec_name attribute as osv.osv does (osv/orm.py:2356)
I am aware you can redefine name_get in your class, but doing so to copy/paste the method and change 2 lines is not a good solution.
Steps to reproduce:
1- Create a class that "_inherit" from product.product with equal "_name" and adds a new field to be used as name.
2- Set _rec_name to that new field
3- Create a new database install any module that uses products (e.g. sale), the module with your class and populate it with products.
4- Go to any view that retrieves the name through name_get (e.g. Sales->
Result observed:
The produc names displayed are the ones stored in the field "name", not your new field.
Result expected:
The names you defined in your new field should appear in the view.
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Agreed !! We have to call super name_get.
Thank you!