[ALL Versions] orm.py : Multi level inherits produce wrong aliases in query

Bug #1261003 reported by Mario Arias
6
This bug affects 1 person
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.partner_id = ...." that is invalid as "res_users" should by replaced by its alias.

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.