diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index ea96c30c4..2259c3f16 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -387,7 +387,9 @@ class WizardUpdateChartsAccounts(models.TransientModel): self.log = log_output.getvalue() # Check if errors where detected and wether we should stop. if EXCEPTION_TEXT in self.log and not self.continue_on_errors: - raise exceptions.UserError(_("One or more errors detected!\n\n%s") % self.log) + raise exceptions.UserError( + _("One or more errors detected!\n\n%s") % self.log + ) # Store the data and go to the next step. self.state = "done" return self._reopen() diff --git a/account_loan/model/account_loan_line.py b/account_loan/model/account_loan_line.py index 9fde711fd..bcd4ebb71 100644 --- a/account_loan/model/account_loan_line.py +++ b/account_loan/model/account_loan_line.py @@ -337,7 +337,7 @@ class AccountLoanLine(models.Model): ): raise UserError(_("Some moves must be created first")) move = self.env["account.move"].create(record.move_vals()) - move.post() + move.action_post() res.append(move.id) return res @@ -367,7 +367,7 @@ class AccountLoanLine(models.Model): ): invoice.write({"line_ids": record._get_long_term_move_line_vals()}) if record.loan_id.post_invoice: - invoice.post() + invoice.action_post() return res def _get_long_term_move_line_vals(self): diff --git a/account_loan/model/account_move.py b/account_loan/model/account_move.py index ff8825f6f..8b58d0c9e 100644 --- a/account_loan/model/account_move.py +++ b/account_loan/model/account_move.py @@ -19,8 +19,8 @@ class AccountMove(models.Model): ondelete="restrict", ) - def post(self): - res = super().post() + def action_post(self): + res = super().action_post() for record in self: loan_line_id = record.loan_line_id if loan_line_id: diff --git a/account_loan/tests/test_loan.py b/account_loan/tests/test_loan.py index 3fbb15257..fbca7e9a6 100644 --- a/account_loan/tests/test_loan.py +++ b/account_loan/tests/test_loan.py @@ -305,7 +305,7 @@ class TestLoan(TransactionCase): self.assertTrue(line.move_ids) self.assertEqual(line.move_ids.state, "draft") self.assertTrue(line.has_moves) - line.move_ids.post() + line.move_ids.action_post() self.assertEqual(line.move_ids.state, "posted") self.assertIn( line.move_ids.id, diff --git a/account_loan/wizard/account_loan_post.py b/account_loan/wizard/account_loan_post.py index e150c18ec..3c95068f4 100644 --- a/account_loan/wizard/account_loan_post.py +++ b/account_loan/wizard/account_loan_post.py @@ -90,4 +90,4 @@ class AccountLoanPost(models.TransientModel): raise UserError(_("Only loans in draft state can be posted")) self.loan_id.post() move = self.env["account.move"].create(self.move_vals()) - move.post() + move.action_post()