diff --git a/l10n_br_account_due_list/models/account_invoice.py b/l10n_br_account_due_list/models/account_invoice.py index ab3a3db30663..eaad64b82e1b 100644 --- a/l10n_br_account_due_list/models/account_invoice.py +++ b/l10n_br_account_due_list/models/account_invoice.py @@ -38,4 +38,4 @@ def _compute_payments(self): invoice_partials, exchange_diff_moves, ) = move._get_reconciled_invoices_partials() - move.payment_move_line_ids = invoice_partials + exchange_diff_moves + move.payment_move_line_ids = [partial[2].id for partial in invoice_partials] diff --git a/l10n_br_account_due_list/tests/test_payments.py b/l10n_br_account_due_list/tests/test_payments.py index df7c950461ea..06c0749ff6d4 100644 --- a/l10n_br_account_due_list/tests/test_payments.py +++ b/l10n_br_account_due_list/tests/test_payments.py @@ -5,33 +5,26 @@ from odoo.tests import Form, common -class TestPayments(common.SavepointCase): +class TestPayments(common.TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() - cls.account_type_receivable = cls.env["account.account.type"].create( - {"name": "Test", "type": "receivable", "internal_group": "income"} - ) cls.account_receivable = cls.env["account.account"].create( { "name": "Test receivable account", "code": "ACCRV", - "user_type_id": cls.account_type_receivable.id, + "account_type": "asset_receivable", "reconcile": True, } ) - cls.account_type_payable = cls.env["account.account.type"].create( - {"name": "Test", "type": "payable", "internal_group": "income"} - ) cls.account_payable = cls.env["account.account"].create( { "name": "Test payable account", "code": "ACCPAY", - "user_type_id": cls.account_type_payable.id, + "account_type": "liability_payable", "reconcile": True, } ) - cls.partner_1 = cls.env["res.partner"].create( { "name": "Mr. Odoo",