summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/relational_fields.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2018-02-26 09:38:44 +0100
committerGéry Debongnie <ged@odoo.com>2018-03-01 16:08:22 +0100
commit132137939cc8460868a0e77ff78814a9d95e5a56 (patch)
treec9458915de82c625a07696de316b45aa3824c56d /addons/web/static/src/js/fields/relational_fields.js
parent3ad3e450e468f3ad37c627cf7a0d5f92aa4777b8 (diff)
[FIX] web: prevent footer from being rerendered
In some cases, the footer in a form view dialog could be duplicated. The reason was that the form view was rerendered completely, footer included, by the renderer, out of the formcontroller control (it is the formcontroller's job to move the footer buttons to the footer). A possible fix is to work on the form renderer to make it aware that the footer buttons are expected to be only rendered once, but it has the disadvantage to be a fix specific to this issue, and any other form view behaviour with some side effects may have the same issue. This commit tries to prevent the form view from rerendering itself completely in those cases. This also has the disadvantage of possibly not being a complete fix, if some edge cases are missed. However, I have the feeling that we still want to avoid rerendering the full view if possible.
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index ee5b8c7726c..af3467d8c82 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -1007,7 +1007,10 @@ var FieldX2Many = AbstractField.extend({
* @param {OdooEvent} ev
*/
_onDiscardChanges: function (ev) {
- ev.data.fieldName = this.name;
+ if (ev.target !== this) {
+ ev.stopPropagation();
+ this.trigger_up('discard_changes', _.extend({}, ev.data, {fieldName: this.name}));
+ }
},
/**
* Called when the renderer asks to edit a line, in that case simply tells