From c79bb3c9c6ba7fcbd6cd8ad3919f83a4fa777d0a Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Thu, 16 Feb 2023 12:17:01 +0000 Subject: [PATCH] [FIX] web_editor: fix missing setDirty prop Commit [1] removed the protection around the call to setDirty because setDirty is always defined when the field is initialized through the standard field.js mechanism. However, in todo_list.js in hr_payroll, the html field is called without going through that mechanism, resulting in the prop being missing and the call to fail with a traceback. This could be fixed by adding the missing prop to todo_list.js, but other people are likely to do the same mistake in the future so adding a default of our own is probably better to avoid future similar bugs. [1]: https://github.com/odoo/odoo/commit/f56e3bca2456f04616982a9a0e77b8d4c5a0abff closes odoo/odoo#112994 X-original-commit: a6043b3aa290d6cecaabc02995e490f44cbd6ce2 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/backend/html_field.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index e5dfc960685..35f166bcf28 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -600,7 +600,10 @@ HtmlField.components = { TranslationButton, HtmlFieldWysiwygAdapterComponent, }; -HtmlField.defaultProps = {dynamicPlaceholder: false}; +HtmlField.defaultProps = { + dynamicPlaceholder: false, + setDirty: () => {}, +}; HtmlField.props = { ...standardFieldProps, isTranslatable: { type: Boolean, optional: true },