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
policy = line.account_id.get_partner_policy()
if policy == 'always' and not line.partner_id:
return _("Partner policy is set to 'Always' "
"with account '%s' but the "
"partner is missing in the account "
"move line with label '%s'." %
(line.account_id.name_get()[0][1],
line.name))
return _(
"Partner policy is set to 'Always' with account '%s' but "
"the partner is missing in the account move line with "
"label '%s'.") % (line.account_id.name_get()[0][1],
line.name)
elif policy == 'never' and line.partner_id:
return _("Partner policy is set to 'Never' "
"with account '%s' but the "
"account move line with label '%s' "
"has a partner '%s'." %
(line.account_id.name_get()[0][1],
return _(
"Partner policy is set to 'Never' with account '%s' but "
"the account move line with label '%s' has a partner "
"'%s'.") % (line.account_id.name_get()[0][1],
line.name,
line.partner_id.name))
line.partner_id.name)
@api.multi
@api.constrains('partner_id', 'account_id', 'debit', 'credit')