Skip to content

Commit

Permalink
[FIX]Fix tests, problem due to account.type that has been deleted in …
Browse files Browse the repository at this point in the history
…Odoo 16
  • Loading branch information
matteonext committed Apr 13, 2023
1 parent f6ee263 commit de9428a
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions l10n_it_asset_management/tests/test_l10n_it_asset_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields
from odoo.exceptions import ValidationError
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.tools.date_utils import relativedelta


class TestAssets(SavepointCase):
class TestAssets(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.data_account_type_current_assets = cls.env.ref(
"account.data_account_type_current_assets"
)
cls.data_account_type_current_liabilities = cls.env.ref(
"account.data_account_type_current_liabilities"
)
# cls.data_account_type_current_assets = cls.env.ref(
# "account.data_account_type_current_assets"
# )
# cls.data_account_type_current_liabilities = cls.env.ref(
# "account.data_account_type_current_liabilities"
# )
cls.asset_category_1 = cls.env["asset.category"].create(
{
"name": "Asset category 1",
"asset_account_id": cls.env["account.account"]
.search(
[
(
"user_type_id",
"account_type",
"=",
cls.env.ref("account.data_account_type_fixed_assets").id,
"asset_fixed"
)
],
limit=1,
Expand All @@ -35,9 +35,9 @@ def setUpClass(cls):
.search(
[
(
"user_type_id",
"account_type",
"=",
cls.env.ref("account.data_account_type_expenses").id,
"expense",
)
],
limit=1,
Expand All @@ -47,11 +47,9 @@ def setUpClass(cls):
.search(
[
(
"user_type_id",
"account_type",
"=",
cls.env.ref(
"account.data_account_type_non_current_assets"
).id,
"asset_non_current"
)
],
limit=1,
Expand All @@ -61,9 +59,9 @@ def setUpClass(cls):
.search(
[
(
"user_type_id",
"account_type",
"=",
cls.env.ref("account.data_account_type_revenue").id,
"expense_direct_cost"
)
],
limit=1,
Expand All @@ -76,9 +74,9 @@ def setUpClass(cls):
.search(
[
(
"user_type_id",
"account_type",
"=",
cls.env.ref("account.data_account_type_expenses").id,
"expense"
)
],
limit=1,
Expand All @@ -104,9 +102,7 @@ def setUpClass(cls):
{
"name": "Deductable tax",
"code": "DEDTAX",
"user_type_id": cls.env.ref(
"account.data_account_type_current_assets"
).id,
"account_type": "asset_current",
}
)
cls.tax_22_partial_60 = cls.env["account.tax"].create(
Expand Down

0 comments on commit de9428a

Please sign in to comment.