Merge lp:~openerp-dev/openerp-web/trunk-bug-1116432 into lp:openerp-web

Proposed by Priyank Pandya(OpenERP Trainee)
Status: Rejected
Rejected by: Xavier (Open ERP)
Proposed branch: lp:~openerp-dev/openerp-web/trunk-bug-1116432
Merge into: lp:openerp-web
Diff against target: 12 lines (+1/-1)
1 file modified
addons/web/static/src/js/search.js (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-bug-1116432
Reviewer Review Type Date Requested Status
Xavier (Open ERP) Pending
Review via email: mp+152613@code.launchpad.net

This proposal supersedes a proposal from 2013-03-06.

Description of the change

It uses the filter icon even you use the functionality of group by,
so change the image according to functionality.

To post a comment you must log in.
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote : Posted in a previous version of this proposal

1. This does not check that there is a groupby in the context, only that there is a context (incorrect, you can have a context with no groupby)
2. This issue should be handled by GroupbyGroup, if the icon is incorrect then there is a problem in dispatching between FilterGroup and GroupbyGroup, *this* is the bug which should be fixed.

review: Disapprove
Revision history for this message
Priyank Pandya(OpenERP Trainee) (priyank.pandya-openerp) wrote : Posted in a previous version of this proposal

hi xavier
     As per your suggestion I further investigate issue and found that there is not(never) created GroupbyGroup instance for group by filter due to f.attrs.context && f.attrs.context.group_by line:977 here we get f.attrs.context.group_by as 'undefined'
     Here is improve condition to fix this issue. correct me if I missing something

thanks

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Not correct: the original code broke because code was merged to remove context evaluation from server side, so before attrs.context was a dict (or undefined) and inside maybe there was group_by key. Now attrs.context is a string so can not have group_by key, need to parse attrs.context as python dictionary and then check if there is group_by key. Just checking if there is group_by means filters which are not for grouping will also get configured as grouping, which is not valid.

Fix has already been pushed to 7.0 branch.

Unmerged revisions

3683. By Priyank Pandya(OpenERP Trainee)

[IMP] group by filter icon: create GroupbyGroup instance for group by instade of FilterGroup

3682. By Priyank Pandya(OpenERP Trainee)

[merge] with web

3681. By Priyank Pandya(OpenERP Trainee)

[FIX] web : advanced search - wrong group icon

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/search.js'
2--- addons/web/static/src/js/search.js 2013-02-27 14:12:09 +0000
3+++ addons/web/static/src/js/search.js 2013-03-11 05:47:22 +0000
4@@ -974,7 +974,7 @@
5 // create a GroupbyGroup instead of the current FilterGroup
6 if (!(this instanceof instance.web.search.GroupbyGroup) &&
7 _(filters).all(function (f) {
8- return f.attrs.context && f.attrs.context.group_by; })) {
9+ return f.attrs.context})) {
10 return new instance.web.search.GroupbyGroup(filters, view);
11 }
12 this._super(view);