[15.0][MIG] account_spread_cost_revenue

This commit is contained in:
Saran440
2023-05-29 10:38:12 +07:00
committed by Andrea Stirpe
parent 0fdbf6f02c
commit f3cd6619e1
9 changed files with 48 additions and 55 deletions

View File

@@ -97,7 +97,9 @@ class AccountMoveLine(models.Model):
def _check_spread_reconcile_validity(self):
# Improve error messages of standard Odoo
reconciled_lines = self.filtered(lambda l: l.reconciled)
msg_line = _("Move line: %s (%s), account code: %s\n")
msg_line = _(
"Move line: %(line_id)s (%(line_name)s), account code: %(account_code)s\n"
)
if reconciled_lines:
msg = _("Cannot reconcile entries that are already reconciled:\n")
for line in reconciled_lines:
@@ -146,10 +148,9 @@ class AccountMoveLine(models.Model):
elif len(template) > 1:
raise UserError(
_(
"Too many auto spread templates (%s) matched with the "
"invoice line, %s"
)
% (len(template), line.display_name)
"Too many auto spread templates ({}) matched with the "
"invoice line, {}"
).format(len(template), line.display_name)
)
# Found auto spread template for this invoice line, create it
wizard = self.env["account.spread.invoice.line.link.wizard"].new(