[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:
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user