[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.
This commit is contained in:
Aaron Bohy
2015-07-01 15:27:53 +02:00
parent 1b660c895a
commit c5f3debc32
2 changed files with 2 additions and 4 deletions
@@ -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 || {};
@@ -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);
},