From 9c9b2cde469a4193d12f16daed369a21727b505d Mon Sep 17 00:00:00 2001 From: theerayut Date: Fri, 6 Dec 2024 11:19:30 +0700 Subject: [PATCH] [FIX] sale_invoice_plan: test error --- sale_invoice_plan/tests/test_sale_invoice_plan.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sale_invoice_plan/tests/test_sale_invoice_plan.py b/sale_invoice_plan/tests/test_sale_invoice_plan.py index 4d88ed965fd..3eca6b68fbf 100644 --- a/sale_invoice_plan/tests/test_sale_invoice_plan.py +++ b/sale_invoice_plan/tests/test_sale_invoice_plan.py @@ -22,22 +22,22 @@ def setUpClass(cls): "mail_create_nolog": True, } - # Create base account to simulate a chart of account + # Create base account to simulate a chart of account for payable account user_type_payable = cls.company_data["default_account_payable"] cls.account_payable = cls.env["account.account"].create( { "code": "NC1110", "name": "Test Payable Account", - "user_type_id": user_type_payable.id, + "account_type": user_type_payable.account_type, "reconcile": True, } ) - user_type_receivable = cls.env.ref("account.data_account_type_receivable") + # Create base account to simulate a chart of account for receivable account cls.account_receivable = cls.env["account.account"].create( { "code": "NC1111", "name": "Test Receivable Account", - "user_type_id": user_type_receivable.id, + "account_type": "asset_receivable", "reconcile": True, } ) @@ -92,12 +92,11 @@ def setUpClass(cls): @classmethod def setUpClassicProducts(cls): # Create an expense journal - user_type_income = cls.env.ref("account.data_account_type_direct_costs") cls.account_income_product = cls.env["account.account"].create( { - "code": "INCOME_PROD111", - "name": "Icome - Test Account", - "user_type_id": user_type_income.id, + "code": "4.0.0.0.0", + "name": "Income - Test Account", + "account_type": "income", } ) # Create category