From 6158c5ce04589d7e51928d2d19aa5b2eec05cebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 15 Nov 2017 11:45:26 +0100 Subject: [FIX] web: fix issue with combination of o2m, m2m, and m2o Consider this: a form view with a one2many list view. In the one2many list view, there is a many2one field. When opening the manyone in a modal form view, there is a many2many field. In that situation, clicking on 'Add a new record' on the many2many field had the unfortunate effect of interfering with the one2many field in the main form view, which caused a crash or the modal form view to close unexpectedly. The issue is that an event was simply not properly stopped at the proper location. This is usually not a big deal, but, as described above, it can be a problem in some cases. --- addons/web/static/src/js/fields/relational_fields.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index c9e6f218895..e7cd2e1eebf 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -1191,9 +1191,13 @@ var FieldMany2Many = FieldX2Many.extend({ * * @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 () { + _onAddRecord: function (ev) { var self = this; + ev.stopPropagation(); var domain = this.record.getDomain({fieldName: this.name}); -- cgit v1.2.3