[FIX] web: do not suggest translation for empty HTML field

- Activate more than one language
- Install sale_quotation_builder
- Create a new quotation model without website description
- Create a SO using this model, Save

The 'Please update translations of' is displayed for the website
desctiption, although it is empty: when clicking on the link, no record
is shown.

This happens because an empty HTML field always contains at least
`<p><br></p>`.

We do not consider the latter string for translation.

opw-2274203

closes odoo/odoo#54025

X-original-commit: aad4d516b6fb4b286f24bc536e5ecb67558a0c4d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-07-03 07:43:03 +00:00
parent ea7b5f059c
commit 88c328bcd0
@@ -248,7 +248,7 @@ var FormController = BasicController.extend({
for (var k = 0; k < changedFields.length; k++) {
var field = fields[changedFields[k]];
var fieldData = data[changedFields[k]];
if (field.translate && fieldData) {
if (field.translate && fieldData && fieldData !== '<p><br></p>') {
alertFields[changedFields[k]] = field;
}
}