diff options
| author | Goffin Simon <sig@odoo.com> | 2015-10-13 13:30:47 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2015-10-16 12:11:31 +0200 |
| commit | b00f0185a2dd4b9521c62ee98918cf4f279b64f5 (patch) | |
| tree | c4961a5e92c965f055c58725cdfb970dc8f6723b /addons/web/static/src/xml/base.xml | |
| parent | 1fdd5cf975f56cb0bc273583f871cae7791d77f6 (diff) | |
[FIX] models: read_group on many2one fields
When making on model A a read_group with groupby equal to a many2one field F1 to a model B
which is ordered by a inherited not stored field F2, the group containing all the
records from A with F1 not set was not returned.
Example:
model A= "hr.applicant"
model B= "res.users" (_order = "name,login")
inherited model= "res.partner"
field F1= "user_id"(to "res.users)
field F2= "name"(inherited from "res.partner")
In this example, the query generated by the function "read_group" was:
SELECT min(hr_applicant.id) AS id, count(hr_applicant.id) AS user_id_count , "hr_applicant"."user_id" as "user_id"
FROM "hr_applicant" LEFT JOIN "res_users" as "hr_applicant__user_id" ON ("hr_applicant"."user_id" = "hr_applicant__user_id"."id"),"res_partner" as "hr_applicant__user_id__partner_id"
WHERE ("hr_applicant"."active" = true) AND ("hr_applicant__user_id"."partner_id" = "hr_applicant__user_id__partner_id"."id")
GROUP BY "hr_applicant"."user_id","hr_applicant__user_id__partner_id"."name","hr_applicant__user_id"."login"
ORDER BY "hr_applicant__user_id__partner_id"."name" ,"hr_applicant__user_id"."login"
which always returned "hr.applicant" groups of records with a "user_id" set due to the inner join maked on res_partners.
This inner join on "res_partner" is coming from function "add_join" calling by "_inherits_join_add"
in _generate_order_by_inner.
Introduced by dac52e344c43808d76b8e57a059f803d3863db28
opw:651949
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
0 files changed, 0 insertions, 0 deletions
