Merge lp:~openerp-dev/openerp-web/7.0-context-searchmore-m2o-mat into lp:openerp-web/7.0

Proposed by Martin Trigaux (OpenERP)
Status: Merged
Merged at revision: 4156
Proposed branch: lp:~openerp-dev/openerp-web/7.0-context-searchmore-m2o-mat
Merge into: lp:openerp-web/7.0
Diff against target: 12 lines (+1/-1)
1 file modified
addons/web/static/src/js/view_form.js (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-context-searchmore-m2o-mat
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+210363@code.launchpad.net

Description of the change

[FIX] web: on SearchPopup creation concat build context even if we have initial_ids

  On SearchPopupCreation, if we have initial_ids - 1st search_read() will be
  missing custom context defined on the field.

  1. defined view like this: <field name="my_many2one_field_id" context="{'test': 1}"/>
  2. in we expand the list of available item, name_search() has 'test' in context
  3. in we click on 'Search More', search_read() is missing 'test' in context
  4. if we change filter add/remove item, search_read() will have 'test' in context

  Step 3. is wrong, should also have 'test' in context

To post a comment you must log in.

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/view_form.js'
2--- addons/web/static/src/js/view_form.js 2014-03-07 14:12:57 +0000
3+++ addons/web/static/src/js/view_form.js 2014-03-11 09:16:52 +0000
4@@ -4796,7 +4796,7 @@
5 this.searchview.on('search_data', self, function(domains, contexts, groupbys) {
6 if (self.initial_ids) {
7 self.do_search(domains.concat([[["id", "in", self.initial_ids]], self.domain]),
8- contexts, groupbys);
9+ contexts.concat(self.context), groupbys);
10 self.initial_ids = undefined;
11 } else {
12 self.do_search(domains.concat([self.domain]), contexts.concat(self.context), groupbys);