summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-07-01 14:38:16 +0200
committerAaron Bohy <aab@odoo.com>2015-07-01 15:27:53 +0200
commitc5f3debc3299cf0c25ba948d04abff4a659b0d6e (patch)
tree0cc276f47d68a9539fb931b96ae8d6a018828c5f /addons/web/static/src
parent1b660c895a8673ea9446f19a8bb249638bfc3db6 (diff)
[FIX] web: FormViewDialog: multi select option
Before this rev., the multi_select option wasn't enabled even by setting disable_multiple_selection to false in the options, when the res_id key wasn't defined in options (null != undefined). It was the case for every X2Many views, except for the Many2ManyKanban view as we explicitely set the disable_multiple_selection to false AND res_id to null. However, all X2Many views should enable this option.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/form_common.js4
-rw-r--r--addons/web/static/src/js/views/form_relational_widgets.js2
2 files changed, 2 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/form_common.js b/addons/web/static/src/js/views/form_common.js
index 5f449c2540e..cd6d061919f 100644
--- a/addons/web/static/src/js/views/form_common.js
+++ b/addons/web/static/src/js/views/form_common.js
@@ -841,8 +841,8 @@ var FormViewDialog = ViewDialog.extend({
init: function(parent, options) {
var self = this;
- var multi_select = options.res_id === null && ! options.disable_multiple_selection;
- var readonly = options.res_id !== null && options.readonly;
+ var multi_select = !_.isNumber(options.res_id) && !options.disable_multiple_selection;
+ var readonly = _.isNumber(options.res_id) && options.readonly;
if(!options || !options.buttons) {
options = options || {};
diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js
index 3529ae8a90a..6164468cfba 100644
--- a/addons/web/static/src/js/views/form_relational_widgets.js
+++ b/addons/web/static/src/js/views/form_relational_widgets.js
@@ -1654,13 +1654,11 @@ odoo.define('web_kanban.Many2ManyKanbanView', function (require) {
var self = this;
new common.FormViewDialog(this, {
res_model: self.x2m.field.relation,
- res_id: null,
domain: self.x2m.build_domain(),
context: self.x2m.build_context(),
title: _t("Create: ") + self.x2m.string,
initial_view: "form",
alternative_form_view: self.x2m.field.views ? self.x2m.field.views.form : undefined,
- disable_multiple_selection: false,
create_function: function(data, options) {
return self.x2m.data_create(data, options);
},