[IMP] sale: pass placeholders content to translation call.

Use improved API from #52155 to fallback on the source string when the 
translated string is invalid.
This commit is contained in:
Victor Feyens
2021-06-21 16:43:19 +00:00
parent 80388c3b85
commit 4ddf8f279f
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -449,7 +449,7 @@ class SaleOrder(models.Model):
return {
'warning': {
'title': _("Warning for %s") % partner.name,
'title': _("Warning for %s", partner.name),
'message': partner.sale_warn_msg,
}
}
@@ -577,7 +577,7 @@ class SaleOrder(models.Model):
self.ensure_one()
journal = self.env['account.move'].with_context(default_move_type='out_invoice')._get_default_journal()
if not journal:
raise UserError(_('Please define an accounting sales journal for the company %s (%s).') % (self.company_id.name, self.company_id.id))
raise UserError(_('Please define an accounting sales journal for the company %s (%s).', self.company_id.name, self.company_id.id))
invoice_vals = {
'ref': self.client_order_ref or '',
+1 -1
View File
@@ -158,7 +158,7 @@ class SaleOrderLine(models.Model):
lines = super().create(vals_list)
for line in lines:
if line.product_id and line.order_id.state == 'sale':
msg = _("Extra line with %s ") % (line.product_id.display_name,)
msg = _("Extra line with %s", line.product_id.display_name)
line.order_id.message_post(body=msg)
# create an analytic account if at least an expense product
if line.product_id.expense_policy not in [False, 'no'] and not line.order_id.analytic_account_id: