[IMP] web: support disable_multiple_selection parameter when opening the o2m dialog
PURPOSE Sometimes we want to limit selection of 2many fields to a single record at a time. For example when creating marketing automation activities we want users to create them one at a time to ease linking between them (parent / children relationships). Indeed 2many subrecords have to be created before being selected in other 2many subrecords (i.e. create an activity to set it as parent of another activity). SPECIFICATIONS The open_one2many_record trigger method now accets disable_multiple_selection option in parameter to pass it to the FormViewDialog constructor. LINKS Task ID-2087993 COM PR odoo/odoo#40177 ENT PR odoo/enterprise#6675 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
committed by
Thibault Delavallée
parent
c71b4e13a9
commit
317025d3fb
@@ -1908,6 +1908,7 @@ var FieldOne2Many = FieldX2Many.extend({
|
||||
parentID: this.value.id,
|
||||
viewInfo: this.view,
|
||||
deletable: this.activeActions.delete && params.deletable && this.canDelete,
|
||||
disable_multiple_selection: params.disable_multiple_selection,
|
||||
}));
|
||||
},
|
||||
|
||||
@@ -1968,6 +1969,7 @@ var FieldOne2Many = FieldX2Many.extend({
|
||||
} else {
|
||||
this._openFormDialog({
|
||||
context: data.context && data.context[0],
|
||||
disable_multiple_selection: data.disable_multiple_selection,
|
||||
on_saved: function (record) {
|
||||
self._setValue({ operation: 'ADD', id: record.id });
|
||||
},
|
||||
|
||||
@@ -617,6 +617,7 @@ var FormController = BasicController.extend({
|
||||
parentID: data.parentID,
|
||||
readonly: data.readonly,
|
||||
deletable: record ? data.deletable : false,
|
||||
disable_multiple_selection: data.disable_multiple_selection,
|
||||
recordID: record && record.id,
|
||||
res_id: record && record.res_id,
|
||||
res_model: data.field.relation,
|
||||
|
||||
Reference in New Issue
Block a user