summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/form_view.js
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2019-06-14 12:33:27 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2019-06-14 13:38:09 +0000
commit6a29dec93f5245fbfa490481edf17f3d46c295df (patch)
tree6ed699602e6c99238d5f3cc23c6314c5c7b63583 /addons/mail/static/src/js/form_view.js
parentd663ab3345b2ffba62ffb20163215326d6b5f12d (diff)
[FIX] mail: message_attachment_count can be explicit in form view
Before this commit, it was not possible to have the field message_attachment_count explicitly defined in the form view. It crashed inelegantly if it were the case After this commit, it is possible to have that field in the form view OPW 1998503 closes odoo/odoo#34143 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Diffstat (limited to 'addons/mail/static/src/js/form_view.js')
-rw-r--r--addons/mail/static/src/js/form_view.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/form_view.js b/addons/mail/static/src/js/form_view.js
index 0e1623d0dcf..6a2a41091aa 100644
--- a/addons/mail/static/src/js/form_view.js
+++ b/addons/mail/static/src/js/form_view.js
@@ -16,8 +16,9 @@ FormView.include({
init: function () {
this._super.apply(this, arguments);
- if ('message_ids' in this.fieldsInfo[this.viewType]) {
- this.fieldsInfo[this.viewType].message_attachment_count = {};
+ var fieldsInfo = this.fieldsInfo[this.viewType];
+ if ('message_ids' in fieldsInfo && !('message_attachment_count' in fieldsInfo)) {
+ fieldsInfo.message_attachment_count = {};
}
},
});