odoo/openerp/addons/base/tests
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
..
__init__.py [MERGE] forward port of branch 7.0 up to e1daaff 2015-03-18 12:52:33 +01:00
base_test.yml [IMP] use model._fields instead of model._all_columns to cover all fields 2014-11-04 13:47:57 +01:00
test_acl.py [FIX] tests: make self.assertRaises() return the expected object 2014-11-17 15:39:14 +01:00
test_api.py [IMP] ormcache: turn it into a global LRU cache shared among registries 2015-03-23 14:36:14 +01:00
test_base.py [FIX] mail: backport of rev 752a07c to 8.0 2015-07-07 08:52:44 +02:00
test_basecase.py move tests 2014-02-09 01:37:45 +01:00
test_db_cursor.py [FIX] tests: db name moved from constant to function 2015-06-12 12:43:01 +02:00
test_expression.py [ADD] base: test to check too long table aliases 2015-09-08 11:53:29 +02:00
test_func.py [FIX] re-enable test func and qweb 2014-02-09 15:33:26 +01:00
test_ir_actions.py [FIX] actions: match the behavior of multi actions with its help text 2014-10-08 17:29:36 +02:00
test_ir_attachment.py [FIX] test ir_attachment: files are not directories 2014-01-16 23:42:07 +01:00
test_ir_filters.py [FIX] models: read_group on many2one fields 2015-10-16 12:11:31 +02:00
test_ir_rule.yml [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
test_ir_sequence.py [FIX] tests: db name moved from constant to function 2015-06-12 12:43:01 +02:00
test_ir_values.py [FIX] do not hardcode ids in tests 2012-12-05 18:37:33 +01:00
test_mail.py [FIX] tools: mail: fixed read more link tha could be placed in a block to be removed, being considered as a quote 2014-08-20 14:10:20 +02:00
test_mail_examples.py [FIX] tools: mail: fixed read more link tha could be placed in a block to be removed, being considered as a quote 2014-08-20 14:10:20 +02:00
test_menu.py [FIX] Remove unused imports and fix some imports that doesn't use the new namespace 2012-12-17 15:30:29 +01:00
test_misc.py move tests 2014-02-09 01:37:45 +01:00
test_orm.py [FIX] tests: db name moved from constant to function 2015-06-12 12:43:01 +02:00
test_osv.py move tests 2014-02-09 01:37:45 +01:00
test_osv_expression.yml [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
test_qweb.py [ADD] qweb: handling of t-att=mapping 2014-10-06 19:13:44 +02:00
test_res_config.py [FIX] res_config tests: isinstance(x, long) is False when x is an int! 2013-05-08 17:32:07 +02:00
test_res_lang.py [FIX] remove useless asserts text 2013-02-12 15:18:30 +01:00
test_search.py [IMP] base: tests, move patch_order to TransactionCase 2015-09-08 11:53:18 +02:00
test_translate.py move tests 2014-02-09 01:37:45 +01:00
test_uninstall.py [FIX] tests: db name moved from constant to function 2015-06-12 12:43:01 +02:00
test_view_validation.py move tests 2014-02-09 01:37:45 +01:00
test_views.py [FIX] tests: db name moved from constant to function 2015-06-12 12:43:01 +02:00
test_xmlrpc.py [FIX] tests: db name moved from constant to function 2015-06-12 12:43:01 +02:00