[FIX] mail: fix unstar button title

The toggle star action view currently does not take into account the
starred state of the message, returning "Mark as Todo" unconditionally
as a title for the button.

This commit adds a check for the starred state to return an appropriate
title if the message is already starred.

closes odoo/odoo#103432

X-original-commit: b77660850bb0dbf4fad2a52d931e230f4acde975
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit is contained in:
Louis Wicket (wil)
2022-10-18 17:12:07 +02:00
parent 5ba91f1d69
commit eb24659182
3 changed files with 18 additions and 0 deletions
+14
View File
@@ -6168,6 +6168,13 @@ msgstr ""
msgid "Remove email from blacklist wizard"
msgstr ""
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/models/message_action_view.js:0
#, python-format
msgid "Remove from Todo"
msgstr ""
#. module: mail
#: model_terms:ir.ui.view,arch_db:mail.email_template_form
msgid "Remove the contextual action to use this template on related documents"
@@ -7810,6 +7817,13 @@ msgstr ""
msgid "Upload Document"
msgstr ""
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/backend_components/activity_list_view_item/activity_list_view_item.xml:0
#, python-format
msgid "Upload File"
msgstr ""
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/backend_components/activity_list_view_item/activity_list_view_item.xml:0
@@ -35,6 +35,7 @@
<t t-foreach="activityListView.plannedActivityListViewItems" t-as="activityListViewItem" t-key="activityListViewItem">
<ActivityListViewItem record="activityListViewItem"/>
</t>
</t>
</div>
<button class="o_ActivityListView_addActivityButton btn btn-secondary p-3 text-center" t-on-click="activityListView.onClickAddActivityButton">
<i class="fa fa-plus fa-fw"></i><strong>Schedule an activity</strong>
@@ -175,6 +175,9 @@ registerModel({
case this.messageAction.messageActionListOwnerAsToggleCompact:
return this.env._t("Compact");
case this.messageAction.messageActionListOwnerAsToggleStar:
if (this.messageAction.messageActionListOwner.message.isStarred) {
return this.env._t("Remove from Todo");
}
return this.env._t("Mark as Todo");
default:
return clear();