[FIX] mail: fix className can be null in mixin

Before this commit, the className can be null and then this processing:
`this.className += ' o_clickable_m2x_avatar';` gives
'null o_clickable_m2x_avatar' in the class of the element classList.

This commit checks if the className is not null if yes, then we add the
the class otherwise the className is created in this mixins.

closes odoo/odoo#71461

X-original-commit: d25459e6cb
Related: odoo/enterprise#18605
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Xavier BOL (xbo)
2021-06-01 08:14:15 +00:00
parent 693398c79a
commit a6e7c41d5e
+1 -1
View File
@@ -29,7 +29,7 @@ const M2XAvatarMixin = {
if (!this.supportedModels.includes(this.field.relation)) {
throw new Error(`This widget is only supported on many2one and many2many fields pointing to ${JSON.stringify(this.supportedModels)}`);
}
this.className += ' o_clickable_m2x_avatar';
this.className = `${this.className || ''} o_clickable_m2x_avatar`.trim();
},
//--------------------------------------------------------------------------