2
0

FIX translation method (bug reported by yvaucher)

This commit is contained in:
Alexis de Lattre 2017-01-10 16:36:07 +01:00
parent efafe5855d
commit 642b63e6c2

View File

@ -51,20 +51,18 @@ class AccountMoveLine(models.Model):
continue continue
policy = line.account_id.get_partner_policy() policy = line.account_id.get_partner_policy()
if policy == 'always' and not line.partner_id: if policy == 'always' and not line.partner_id:
return _("Partner policy is set to 'Always' " return _(
"with account '%s' but the " "Partner policy is set to 'Always' with account '%s' but "
"partner is missing in the account " "the partner is missing in the account move line with "
"move line with label '%s'." % "label '%s'.") % (line.account_id.name_get()[0][1],
(line.account_id.name_get()[0][1], line.name)
line.name))
elif policy == 'never' and line.partner_id: elif policy == 'never' and line.partner_id:
return _("Partner policy is set to 'Never' " return _(
"with account '%s' but the " "Partner policy is set to 'Never' with account '%s' but "
"account move line with label '%s' " "the account move line with label '%s' has a partner "
"has a partner '%s'." % "'%s'.") % (line.account_id.name_get()[0][1],
(line.account_id.name_get()[0][1], line.name,
line.name, line.partner_id.name)
line.partner_id.name))
@api.multi @api.multi
@api.constrains('partner_id', 'account_id', 'debit', 'credit') @api.constrains('partner_id', 'account_id', 'debit', 'credit')