mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract: Migration to 17.0
This commit is contained in:
@@ -857,25 +857,15 @@ class TestContract(TestContractBase):
|
||||
max_date_end,
|
||||
):
|
||||
return (
|
||||
"Error in case %s:"
|
||||
"date_start: %s, "
|
||||
"date_end: %s, "
|
||||
"last_date_invoiced: %s, "
|
||||
"recurring_next_date: %s, "
|
||||
"recurring_invoicing_type: %s, "
|
||||
"recurring_rule_type: %s, "
|
||||
"recurring_interval: %s, "
|
||||
"max_date_end: %s, "
|
||||
) % (
|
||||
case,
|
||||
date_start,
|
||||
date_end,
|
||||
last_date_invoiced,
|
||||
recurring_next_date,
|
||||
recurring_invoicing_type,
|
||||
recurring_rule_type,
|
||||
recurring_interval,
|
||||
max_date_end,
|
||||
f"Error in case {case}:"
|
||||
f"date_start: {date_start}, "
|
||||
f"date_end: {date_end}, "
|
||||
f"last_date_invoiced: {last_date_invoiced}, "
|
||||
f"recurring_next_date: {recurring_next_date}, "
|
||||
f"recurring_invoicing_type: {recurring_invoicing_type}, "
|
||||
f"recurring_rule_type: {recurring_rule_type}, "
|
||||
f"recurring_interval: {recurring_interval}, "
|
||||
f"max_date_end: {max_date_end}, "
|
||||
)
|
||||
|
||||
Result = namedtuple(
|
||||
|
||||
@@ -8,12 +8,16 @@ 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)
|
||||
chart_template = cls.env["account.chart.template"]._guess_chart_template(
|
||||
cls.company_2.country_id
|
||||
)
|
||||
cls.env["account.chart.template"].try_loading(
|
||||
chart_template, company=cls.company_2, install_demo=False
|
||||
)
|
||||
cls.env.user.company_ids |= cls.company_2
|
||||
|
||||
cls.contract_mc = (
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Copyright 2020 Tecnativa - Víctor Martínez
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl)
|
||||
|
||||
import odoo.tests
|
||||
from odoo import http
|
||||
from odoo.tests import HttpCase, tagged
|
||||
|
||||
|
||||
@odoo.tests.tagged("post_install", "-at_install")
|
||||
class TestContractPortal(odoo.tests.HttpCase):
|
||||
@tagged("post_install", "-at_install")
|
||||
class TestContractPortal(HttpCase):
|
||||
def test_tour(self):
|
||||
partner = self.env["res.partner"].create({"name": "partner test contract"})
|
||||
contract = self.env["contract.contract"].create(
|
||||
@@ -14,12 +14,7 @@ class TestContractPortal(odoo.tests.HttpCase):
|
||||
)
|
||||
user_portal = self.env.ref("base.demo_user0")
|
||||
contract.message_subscribe(partner_ids=user_portal.partner_id.ids)
|
||||
self.browser_js(
|
||||
"/",
|
||||
"odoo.__DEBUG__.services['web_tour.tour'].run('contract_portal_tour')",
|
||||
"odoo.__DEBUG__.services['web_tour.tour'].tours.contract_portal_tour.ready",
|
||||
login="portal",
|
||||
)
|
||||
self.start_tour("/", "contract_portal_tour", login="portal")
|
||||
# Contract access
|
||||
self.authenticate("portal", "portal")
|
||||
http.root.session_store.save(self.session)
|
||||
|
||||
Reference in New Issue
Block a user