[FIX] mail: translate server action names

Following the recent server action refactoring, it seems translations have been
forgotten in the review process.

Task-3527758 (Base Automation Refactor Fiximp)
Part of Task-3527752 (Mail: The Pre-Major Freeze FixImpLint)

Part-of: odoo/odoo#137133
This commit is contained in:
Thibault Delavallée
2023-10-02 06:54:38 +00:00
parent a8b08b8e92
commit 2f9d5258fb
2 changed files with 20 additions and 5 deletions
+16 -4
View File
@@ -85,13 +85,25 @@ class ServerActions(models.Model):
if not action.state or not self.env.context.get('automatic_action_name'):
continue
if action.state == 'mail_post':
action.name = 'Send email: %s' % action.template_id.name
action.name = _(
'Send email: %(template_name)s',
template_name=action.template_id.name
)
elif action.state == 'followers':
action.name = 'Add followers: %s' % ', '.join(action.partner_ids.mapped('name'))
action.name = _(
'Add followers: %(partner_names)s',
partner_names=', '.join(action.partner_ids.mapped('name'))
)
elif action.state == 'remove_followers':
action.name = 'Remove followers: %s' % ', '.join(action.partner_ids.mapped('name'))
action.name = _(
'Remove followers: %(partner_names)s',
partner_names=', '.join(action.partner_ids.mapped('name'))
)
elif action.state == 'next_activity':
action.name = 'Next activity: %s' % action.activity_summary
action.name = _(
'Next activity: %(activity_name)s',
activity_name=action.activity_summary or action.activit_type_id.name
)
else:
super(ServerActions, action)._compute_name()
+4 -1
View File
@@ -32,7 +32,10 @@ class ServerActions(models.Model):
if not action.state or not self.env.context.get('automatic_action_name'):
continue
if action.state == 'sms':
action.name = 'Send SMS: %s' % action.sms_template_id.name
action.name = _(
'Send SMS: %(template_name)s',
template_name=action.sms_template_id.name
)
else:
super(ServerActions, action)._compute_name()