[FIX] web_editor: ZWS in monetary fields
Value changed in monetary fields were not saved correctly. Zero Width Spaces in the monetary field new value caused the model to reject the value as the format (numerical) was not compliant. task-2679088 X-original-commit: a776e55c6fb03861eed9668fad259c0a92b9aff8 Part-of: odoo/odoo#80071
This commit is contained in:
@@ -1863,12 +1863,17 @@ const Wysiwyg = Widget.extend({
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
// remove ZeroWidthSpace from odoo field value
|
||||
// ZeroWidthSpace may be present from OdooEditor edition process
|
||||
let escapedHtml = this._getEscapedElement($el).prop('outerHTML');
|
||||
escapedHtml = escapedHtml.replace(/[\u200B-\u200D\uFEFF]/g, '');
|
||||
|
||||
return this._rpc({
|
||||
model: 'ir.ui.view',
|
||||
method: 'save',
|
||||
args: [
|
||||
viewID,
|
||||
this._getEscapedElement($el).prop('outerHTML'),
|
||||
escapedHtml,
|
||||
!$el.data('oe-expression') && $el.data('oe-xpath') || null, // Note: hacky way to get the oe-xpath only if not a t-field
|
||||
],
|
||||
context: context,
|
||||
|
||||
Reference in New Issue
Block a user