[FIX] web: see selection didn't show selection

This fix gives the domain to the "See selection" view opened from a
FieldCharDomain.

In Odoo 8.0, this widget is available at two places:

- mass_mailing: Marketing > Mass Mailing | Mass Mailing > (any
  newsletter) > "See selection".

- gamification: Settings > Gamification Tools > Challenge > (any
  challenge) > "See selection".

With this fix the "Selected records" view display selected records.

closes #6463
opw-633201
This commit is contained in:
Nicolas Lempereur 2015-04-24 17:06:35 +02:00
parent a90b94f291
commit 71aa34fb54
1 changed files with 5 additions and 1 deletions

View File

@ -2601,13 +2601,17 @@ instance.web.form.FieldCharDomain = instance.web.form.AbstractField.extend(insta
var self = this;
var model = this.options.model || this.field_manager.get_field_value(this.options.model_field);
this.pop = new instance.web.form.SelectCreatePopup(this);
var domain = [];
if(this.get('effective_readonly')) {
domain = instance.web.pyeval.eval('domain', self.get_value());
}
this.pop.select_element(
model, {
title: this.get('effective_readonly') ? 'Selected records' : 'Select records...',
readonly: this.get('effective_readonly'),
disable_multiple_selection: this.get('effective_readonly'),
no_create: this.get('effective_readonly'),
}, [], this.build_context());
}, domain, this.build_context());
this.pop.on("elements_selected", self, function(element_ids) {
if (this.pop.$('input.oe_list_record_selector').prop('checked')) {
var search_data = this.pop.searchview.build_search_data();