[ADD] web: prevent the propagation of context keys containing prefix show_

This decision comes from the following bug:
- Go to Sales -> Quotations, and open any existing quotation in form view (the
  partner must have an address defined)
- Click on the partner
- Click on the stat button "Claims"
- You notice that the address of the partner is included in the search

This is due to the context property show_address which is set to 1 when a
quotation is open. Therefore, it is necessary to filter out this keyword.

Since the prefix "show_" is used for only few context variables, it was decided
to define this pattern as a standard pattern to filter out.

opw-642893
This commit is contained in:
Nicolas Martinelli 2015-06-19 15:05:08 +02:00
parent 35b2463324
commit ac4849f9ca
1 changed files with 1 additions and 1 deletions

View File

@ -1451,7 +1451,7 @@ instance.web.View = instance.web.Widget.extend({
// Wrong group_by values will simply fail and forbid rendering of the destination view
var ncontext = new instance.web.CompoundContext(
_.object(_.reject(_.pairs(dataset.get_context().eval()), function(pair) {
return pair[0].match('^(?:(?:default_|search_default_).+|.+_view_ref|group_by|group_by_no_leaf|active_id|active_ids)$') !== null;
return pair[0].match('^(?:(?:default_|search_default_|show_).+|.+_view_ref|group_by|group_by_no_leaf|active_id|active_ids)$') !== null;
}))
);
ncontext.add(action_data.context || {});