[ALL Versions] orm.py : Multi level inherits produce wrong aliases in query
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
If you define a class that inherits from a second class that inherits from a third class (hence the multi-level "inherits"...) and then on the first class you reference a base field from the third class, the intermediate aliases in the query fail to reflect the correct structure, and use the plain table name instead of the alias.
To test, define a class that "inherits" from res_users, and then try to group by any field that is defined on res_partner.
The query will have something like "res_user.
I am including a patch to _inherits_join_add and _inherits_join_calc on file orm.py that passes the fully qualified alias for intermediate models, so that correct aliases are used inside the query