Skip to content

Commit

Permalink
Merge PR #982 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Aug 17, 2023
2 parents 8848227 + c1589b0 commit f0d213a
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions contract/tests/test_multicompany.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,57 @@ class ContractMulticompanyCase(TestContractBase):
@classmethod
def setUpClass(cls):
super().setUpClass()
chart_template = cls.env.ref("l10n_generic_coa.configurable_chart_template")
cls.company_obj = cls.env["res.company"]
cls.company_1 = cls.env.ref("base.main_company")
vals = {"name": "Company 2"}
cls.company_2 = cls.company_obj.create(vals)
chart_template.try_loading(company=cls.company_2)
cls.env.user.company_ids |= cls.company_2

cls.env["account.journal"].create(
{
"name": "Journal purchase test 1",
"code": "JP1",
"type": "purchase",
"company_id": cls.company_2.id,
}
)
account_payable_type = cls.env["account.account.type"].create(
{
"name": "Payable account type",
"type": "payable",
"internal_group": "liability",
}
)
account_expense_type = cls.env["account.account.type"].create(
{
"name": "Expense account type",
"type": "other",
"internal_group": "expense",
}
)
payable_account = cls.env["account.account"].create(
{
"name": "Payable Account",
"code": "PAY",
"user_type_id": account_payable_type.id,
"reconcile": True,
"company_id": cls.company_2.id,
}
)
expense_account = cls.env["account.account"].create(
{
"name": "Expense Account",
"code": "EXP",
"user_type_id": account_expense_type.id,
"reconcile": False,
"company_id": cls.company_2.id,
}
)
cls.partner.with_company(
cls.company_2
).property_account_payable_id = payable_account.id
cls.product_1.with_company(
cls.company_2
).property_account_expense_id = expense_account.id
cls.contract_mc = (
cls.env["contract.contract"]
.with_company(cls.company_2)
Expand Down

0 comments on commit f0d213a

Please sign in to comment.