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); },