commit
b3861cd4ee
@ -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",
|
||||||
|
@ -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()
|
||||||
|
|
||||||
|
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user