diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2019-06-14 12:33:27 +0000 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2019-06-14 13:38:09 +0000 |
| commit | 6a29dec93f5245fbfa490481edf17f3d46c295df (patch) | |
| tree | 6ed699602e6c99238d5f3cc23c6314c5c7b63583 /addons/mail/static/src/js/form_view.js | |
| parent | d663ab3345b2ffba62ffb20163215326d6b5f12d (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.js | 5 |
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 = {}; } }, }); |
