summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/relational_fields.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js33
1 files changed, 22 insertions, 11 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index c539a3ce12d..93863c2f619 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -1768,21 +1768,13 @@ var FieldMany2Many = FieldX2Many.extend({
supportedFieldTypes: ['many2many'],
//--------------------------------------------------------------------------
- // Handlers
+ // Public
//--------------------------------------------------------------------------
-
/**
- * Opens a SelectCreateDialog.
- *
- * @override
- * @private
- * @param {OdooEvent|MouseEvent} ev this event comes either from the 'Add
- * record' link in the list editable renderer, or from the 'Create' button
- * in the kanban view
+ * Opens a SelectCreateDialog
*/
- _onAddRecord: function (ev) {
+ onAddRecordOpenDialog: function () {
var self = this;
- ev.stopPropagation();
var domain = this.record.getDomain({fieldName: this.name});
new dialogs.SelectCreateDialog(this, {
@@ -1808,6 +1800,25 @@ var FieldMany2Many = FieldX2Many.extend({
}
}).open();
},
+
+ //--------------------------------------------------------------------------
+ // Handlers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Opens a SelectCreateDialog.
+ *
+ * @override
+ * @private
+ * @param {OdooEvent|MouseEvent} ev this event comes either from the 'Add
+ * record' link in the list editable renderer, or from the 'Create' button
+ * in the kanban view
+ */
+ _onAddRecord: function (ev) {
+ ev.stopPropagation();
+ this.onAddRecordOpenDialog();
+ },
+
/**
* Intercepts the 'open_record' event to edit its data and lets it bubble up
* to the form view.