summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml
diff options
context:
space:
mode:
authorParth Choksi <pch@odoo.com>2019-10-23 11:17:03 +0000
committerAlexandre Kühn <aku@odoo.com>2020-01-02 13:38:47 +0000
commite1f4205ef3accbfdcf771ebc9ecb4afd22cbf084 (patch)
treee0998173efa41041b79eabaf139fcf4f7ef8d3cc /addons/mail/static/src/xml
parentdc55cc6468bf9d2fddc47cb5f135af7016ed2a50 (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/xml')
-rw-r--r--addons/mail/static/src/xml/chatter.xml59
1 files changed, 33 insertions, 26 deletions
diff --git a/addons/mail/static/src/xml/chatter.xml b/addons/mail/static/src/xml/chatter.xml
index 715157fa43b..9b05b242d73 100644
--- a/addons/mail/static/src/xml/chatter.xml
+++ b/addons/mail/static/src/xml/chatter.xml
@@ -38,6 +38,38 @@
</div>
<!--
+ Chatter Suggested Partners
+ -->
+ <t t-name="mail.chatter.ComposerSuggestedPartners">
+ <!-- List of followers -->
+ <div class="o_composer_suggested_partners">
+ <t t-foreach='widget.suggestedPartners' t-as='recipient'>
+ <div t-attf-title="Add as recipient and follower (reason: {{recipient.reason}})" t-att-class="recipient_index > 2 ? 'o_suggested_toggle o_hidden' : ''">
+ <div class="custom-control custom-checkbox">
+ <input type="checkbox"
+ class="custom-control-input"
+ t-attf-id="o_composer_suggested_partners_p{{recipient_index}}"
+ t-att-checked="recipient.checked ? 'checked' : undefined"
+ t-att-data-fullname="recipient.full_name"/>
+ <label t-attf-for="o_composer_suggested_partners_p{{recipient_index}}" class="custom-control-label">
+ <t t-esc="recipient.name"/>
+ <t t-if="recipient.email_address">(<t t-esc="recipient.email_address"/>)</t>
+ </label>
+ </div>
+ </div>
+ </t>
+ <t t-if='widget.suggestedPartners.length > 3'>
+ <a href="#" class='o_suggested_show_more_less o_suggested_toggle'>
+ Show <t t-esc="widget.suggestedPartners.length - 3"/> more
+ </a>
+ <a href="#" class='o_suggested_show_more_less o_suggested_toggle o_hidden'>
+ Show <t t-esc="widget.suggestedPartners.length - 3"/> less
+ </a>
+ </t>
+ </div>
+ </t>
+
+ <!--
Chatter composer
@param {mail.composer.Chatter} widget
@@ -61,32 +93,7 @@
</t>
</b>
</small>
- <!-- List of followers -->
- <div class="o_composer_suggested_partners">
- <t t-foreach='widget.suggestedPartners' t-as='recipient'>
- <div t-attf-title="Add as recipient and follower (reason: #{recipient.reason})" t-att-class="recipient_index > 2 ? 'o_suggested_toggle o_hidden' : ''">
- <div class="custom-control custom-checkbox">
- <input type="checkbox"
- class="custom-control-input"
- t-attf-id="o_composer_suggested_partners_p#{recipient_index}"
- t-att-checked="recipient.checked ? 'checked' : undefined"
- t-att-data-fullname="recipient.full_name"/>
- <label t-attf-for="o_composer_suggested_partners_p#{recipient_index}" class="custom-control-label">
- <t t-esc="recipient.name"/>
- <t t-if="recipient.email_address">(<t t-esc="recipient.email_address"/>)</t>
- </label>
- </div>
- </div>
- </t>
- <t t-if='widget.suggestedPartners.length > 3'>
- <a href="#" class='o_suggested_show_more_less o_suggested_toggle'>
- Show <t t-esc="widget.suggestedPartners.length - 3"/> more
- </a>
- <a href="#" class='o_suggested_show_more_less o_suggested_toggle o_hidden'>
- Show <t t-esc="widget.suggestedPartners.length - 3"/> less
- </a>
- </t>
- </div>
+ <t t-call="mail.chatter.ComposerSuggestedPartners"/>
</t>
</t>