[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

lp bug: https://launchpad.net/bugs/1209295 fixed

bzr revid: mat@openerp.com-20140311091522-03imwd5rj3rmwapl
This commit is contained in:
Xavier ALT 2014-03-11 10:15:22 +01:00 committed by Martin Trigaux
parent f166daf065
commit c033e5a535
1 changed files with 1 additions and 1 deletions

View File

@ -4796,7 +4796,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend
this.searchview.on('search_data', self, function(domains, contexts, groupbys) {
if (self.initial_ids) {
self.do_search(domains.concat([[["id", "in", self.initial_ids]], self.domain]),
contexts, groupbys);
contexts.concat(self.context), groupbys);
self.initial_ids = undefined;
} else {
self.do_search(domains.concat([self.domain]), contexts.concat(self.context), groupbys);