Skip to content

Commit

Permalink
[FIX] purchase_sale_inter_company: No buggy demo data
Browse files Browse the repository at this point in the history
Make tests compatible with OCA#110, for the same reason as the specified in that link.
  • Loading branch information
yajo authored and chafique-delli committed Feb 3, 2023
1 parent 8205dc7 commit ac41743
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions purchase_sale_inter_company/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Contributors
* `Tecnativa <https://www.tecnativa.com>`_:

* Carlos Dauden
* Jairo Llopis

Maintainer
----------
Expand Down
3 changes: 0 additions & 3 deletions purchase_sale_inter_company/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,4 @@
'views/res_config_view.xml',
'views/purchase_order_view.xml',
],
'demo': [
'demo/inter_company_purchase_sale.xml',
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,50 @@

from odoo.tests.common import SavepointCase
from odoo.exceptions import AccessError, UserError
from odoo.modules.module import get_resource_path
from odoo.tools import convert_file


class TestPurchaseSaleInterCompany(SavepointCase):

@classmethod
def setUpClass(cls):
super().setUpClass()
cls._load(
"account_invoice_inter_company",
"tests",
"inter_company_invoice.xml",
)
cls._load(
"purchase_sale_inter_company",
"tests",
"inter_company_purchase_sale.xml",
)
cls.purchase_company_a = cls.env.ref(
'purchase_sale_inter_company.purchase_company_a')
cls.company_a = cls.env.ref(
'account_invoice_inter_company.company_a')
'purchase_sale_inter_company.company_a')
cls.company_b = cls.env.ref(
'account_invoice_inter_company.company_b')
'purchase_sale_inter_company.company_b')
cls.company_b.so_from_po = True
cls.user_a = cls.env.ref(
'account_invoice_inter_company.user_company_a')
'purchase_sale_inter_company.user_company_a')
cls.user_b = cls.env.ref(
'account_invoice_inter_company.user_company_b')
'purchase_sale_inter_company.user_company_b')
cls.account_sale_b = cls.env.ref(
'account_invoice_inter_company.a_sale_company_b')
'purchase_sale_inter_company.a_sale_company_b')
cls.product_consultant = cls.env.ref(
'account_invoice_inter_company.product_consultant_multi_company')
'purchase_sale_inter_company.product_consultant_multi_company')
cls.product_consultant.sudo(
cls.user_b.id).property_account_income_id = cls.account_sale_b

@classmethod
def _load(cls, module, *args):
convert_file(
cls.cr, "purchase_sale_inter_company",
get_resource_path(module, *args),
None, 'init', False, 'test', cls.registry._assertion_report,
)

def test_purchase_sale_inter_company(self):
self.purchase_company_a.notes = 'Test note'
# Confirm the purchase of company A
Expand Down

0 comments on commit ac41743

Please sign in to comment.