[IMP] mail: change chatter output for tracked boolean fields
When a tracked boolean value is changed, old and new values are displaye in a chatter message.
Boolean values were not captialised ("true" & "false"). They are now ("True" & "False").
And they now also can be translated.
This commit is contained in:
@@ -295,6 +295,13 @@ class Message extends Component {
|
||||
value.new_value =
|
||||
moment(value.new_value).local().format('LL');
|
||||
}
|
||||
} else if (value.field_type === 'boolean') {
|
||||
if (value.old_value !== undefined){
|
||||
value.old_value = value.old_value ? this.env._t("True") : this.env._t("False");
|
||||
}
|
||||
if (value.new_value !== undefined){
|
||||
value.new_value = value.new_value ? this.env._t("True") : this.env._t("False");
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
@@ -1141,7 +1141,7 @@ QUnit.test('rendering of tracked field with change of value from true to false',
|
||||
await this.createMessageComponent(message);
|
||||
assert.strictEqual(
|
||||
document.querySelector('.o_Message_trackingValue').textContent,
|
||||
"Is Ready:truefalse",
|
||||
"Is Ready:TrueFalse",
|
||||
"should display the correct content of tracked field with change of value from true to false (Is Ready: true -> false)"
|
||||
);
|
||||
});
|
||||
@@ -1163,7 +1163,7 @@ QUnit.test('rendering of tracked field with change of value from false to true',
|
||||
await this.createMessageComponent(message);
|
||||
assert.strictEqual(
|
||||
document.querySelector('.o_Message_trackingValue').textContent,
|
||||
"Is Ready:falsetrue",
|
||||
"Is Ready:FalseTrue",
|
||||
"should display the correct content of tracked field with change of value from false to true (Is Ready: false -> true)"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user