mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] account_loan: post() -> action_post()
account_loan 14.0.1.0.1 account_loan 14.0.1.0.2
This commit is contained in:
committed by
Víctor Martínez
parent
68242ebd6a
commit
adb00d457e
@@ -2,7 +2,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "Account Loan management",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "14.0.1.0.2",
|
||||
"author": "Creu Blanca,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/account-financial-tools",
|
||||
"license": "AGPL-3",
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user