diff options
| author | Parth Choksi <pch@odoo.com> | 2019-10-23 11:17:03 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2020-01-02 13:38:47 +0000 |
| commit | e1f4205ef3accbfdcf771ebc9ecb4afd22cbf084 (patch) | |
| tree | e0998173efa41041b79eabaf139fcf4f7ef8d3cc /addons/mail/static/src/js/form_controller.js | |
| parent | dc55cc6468bf9d2fddc47cb5f135af7016ed2a50 (diff) | |
[FIX] mail: reset suggested partner when record saved
Before this commit, when "Send message" composer was open with some
suggested recipients, and then editing and saving data related to
the suggested recipients, the suggested recipients were not updated
on composer until some user interactions like page reload.
Steps to reproduce:
- Open an opportunity in CRM;
- Open "Send message" composer;
- Change "Email" field;
- Save changes;
> Suggested recipient above composer textarea is not updated with
newly saved email adress.
It becomes updated only after some user interactions, such as toggle
"Log note" then "Send message" or with a page reload.
This commit fixes the issue by updating the suggested recipients on
the composer in real-time when clicking on "Save".
Task-Id 2089816
closes odoo/odoo#40033
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Alexandre Kühn <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/js/form_controller.js')
| -rw-r--r-- | addons/mail/static/src/js/form_controller.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/form_controller.js b/addons/mail/static/src/js/form_controller.js index a165fe850ba..0d4c03d7a64 100644 --- a/addons/mail/static/src/js/form_controller.js +++ b/addons/mail/static/src/js/form_controller.js @@ -14,6 +14,22 @@ FormController.include({ }), //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * @override + */ + async saveRecord() { + const changedFields = await this._super(...arguments); + const chatter = this.renderer.chatter; + if (chatter) { + await chatter.updateSuggestedPartners(); + } + return changedFields; + }, + + //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- |
