odoo/openerp/addons/base
Goffin Simon b00f0185a2 [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 dac52e344c

opw:651949
2015-10-16 12:11:31 +02:00
..
i18n [I18N] Update translation terms from Transifex 2015-10-11 03:04:31 +02:00
ir [FIX] ir_model_fields: fix and simplify update on custom fields 2015-10-01 15:26:07 +02:00
module [MERGE] forward port of branch saas-3 up to d48aa27 2015-09-11 16:38:00 +02:00
report [REF] OpenERP --> Odoo in various UI texts (2) 2014-07-18 14:59:38 +02:00
res [FIX] base: BRL currency position to before value 2015-10-16 11:35:55 +02:00
rng [ADD] views documentation 2014-08-28 15:02:33 +02:00
security [FIX] base, mail: access to ir.config_parameter is now handled by by 2014-08-29 12:01:50 +02:00
static [FIX] openerp: fixed stretching of module icons in kanban view 2015-02-24 13:45:23 +01:00
tests [FIX] models: read_group on many2one fields 2015-10-16 12:11:31 +02:00
workflow [MERGE] forward port of branch saas-3 up to b79f64f 2015-03-18 13:16:23 +01:00
__init__.py [FIX] nonsensical import? 2014-03-10 10:59:18 +01:00
__openerp__.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
base.sql [FIX] Size for icon field of ir_module_module table in base.sql 2014-09-04 01:46:44 +02:00
base_data.xml [Fix] Some missed frontend openerp to odoo changes 2015-01-12 16:17:12 +01:00
base_demo.xml [IMP] account: better fix than edbd0df for reconciliation test 2015-01-05 11:30:49 +01:00
base_menu.xml [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00