From 71aa34fb54cbf68b1db12090096e8e72ef0a85b0 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 24 Apr 2015 17:06:35 +0200 Subject: [PATCH] [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 --- addons/web/static/src/js/view_form.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 0033b3147a1..6c34c359ae3 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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();