[FIX] web_editor: avoid error popup when saving incomplete link dialog

Before this commit saving an incomplete link dialog triggered the
display of a stacktrace error popup.

After this commit saving is cancelled when an attempt at saving an
incomplete link dialog is done. The incorrect fields already did display
their error status.

task-2675252

closes odoo/odoo#80043

X-original-commit: 47f0596233c2d8a09d91cdfae117aa3f595bb6bf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Benoit Socias
2021-11-18 18:45:35 +00:00
parent e20739312a
commit d2f30d1109
@@ -197,6 +197,10 @@ const LinkDialog = Dialog.extend({
*/
save: function () {
this.linkWidget.save();
if (!this.linkWidget.final_data) {
// Invalid form content: do not proceed with save.
return;
}
this.final_data = this.linkWidget.final_data;
return this._super(...arguments);
},