2
0

account_move_template: fix and improve strings

This commit is contained in:
Alexis de Lattre 2023-11-03 13:25:04 +01:00
parent 7a74f0f1ad
commit 6c97f74cb9
3 changed files with 3 additions and 3 deletions

View File

@ -173,7 +173,7 @@ class AccountMoveTemplateLine(models.Model):
) )
opt_account_id = fields.Many2one( opt_account_id = fields.Many2one(
"account.account", "account.account",
string="Account Opt.", string="Account if Negative",
domain="[('company_id', '=', company_id), ('deprecated', '=', False)]", domain="[('company_id', '=', company_id), ('deprecated', '=', False)]",
check_company=True, check_company=True,
help="When amount is negative, use this account instead", help="When amount is negative, use this account instead",

View File

@ -243,7 +243,7 @@ class TestAccountMoveTemplateEnhanced(TransactionCase):
f.template_id = self.move_template f.template_id = self.move_template
f.overwrite = str({"P0": {"amount": 100}}) f.overwrite = str({"P0": {"amount": 100}})
template_run = f.save() template_run = f.save()
msg_error = "Keys must be line sequence, i..e, L1, L2, ..." msg_error = "Keys must be line sequence i.e. L1, L2, ..."
with self.assertRaisesRegex(ValidationError, msg_error): with self.assertRaisesRegex(ValidationError, msg_error):
template_run.load_lines() template_run.load_lines()

View File

@ -120,7 +120,7 @@ Valid dictionary to overwrite template lines:
# First level keys must be L1, L2, ... # First level keys must be L1, L2, ...
keys = overwrite_vals.keys() keys = overwrite_vals.keys()
if list(filter(lambda x: x[:1] != "L" or not x[1:].isdigit(), keys)): if list(filter(lambda x: x[:1] != "L" or not x[1:].isdigit(), keys)):
raise ValidationError(_("Keys must be line sequence, i..e, L1, L2, ...")) raise ValidationError(_("Keys must be line sequence i.e. L1, L2, ..."))
# Second level keys must be a valid keys # Second level keys must be a valid keys
try: try:
if dict( if dict(