Merge lp:~openerp-dev/openerp-web/7.0-opw-601491ContextGroupByPropagationIssue-msh into lp:openerp-web/7.0
Status: | Merged |
---|---|
Merged at revision: | 4181 |
Proposed branch: | lp:~openerp-dev/openerp-web/7.0-opw-601491ContextGroupByPropagationIssue-msh |
Merge into: | lp:openerp-web/7.0 |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~openerp-dev/openerp-web/7.0-opw-601491ContextGroupByPropagationIssue-msh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stefan Rijnhart (Opener) (community) | Approve | ||
Guewen Baconnier @ Camptocamp (community) | Approve | ||
Ronald Portier (Therp) (community) | Approve | ||
Nicolas Bessi - Camptocamp (community) | no test, code review | Approve | |
Xavier (Open ERP) | Pending | ||
Martin Trigaux (OpenERP) | Pending | ||
Review via email:
|
Description of the change
Hello,
Fixed the issue of traceback on clicking kanban link from project.project kanban.
Demo: Open Kanban view of prject and -> group by parent -> now click on Task link.
Result: Traceback
Expected: It should open Task kanban view.
Reason: When we do grouping it adds groupby in context and when we click on link of kanban it excutes the action same as button action performed on form/list view, the issue is that do_execute_action propagate the group_by to next action, which is not required, propagation of group_by in context is required.
Say for example I have a button in form view type action, I perform action, so do_execute_action is called which in turn loads the action for some other object, so if we pass group_by in context then next action will try to do grouping on that field and fails if that field is not available in database, even if field with same name available by chance then even we didn't define to do grouping on action still it will do grouping.
In our case we do grouping on parent_id field of project.project, and then we performs action by clicking Task link so do_execute_action loads Task action and propagate the current dataset context by extending action context + current dataset context(current dataset context has group_by parent_id field) and hence read_group is called with group_by parent_id field to load kanban view of project.task which is wrong.
There is no need to propagate group_by as well as search_default values in context when dataset.model and action.model is different, hence removed the those keys of current dataset context before updating action context with current dataset context.
Thanks.
Thanks for the fix! Tested, works well.