Skip to content

Commit b85f94b

Browse files
committed
[ADD] test_purchase_sale_stock_dropshipping_inter_company : new module for tests
Add tests for purchase_sale_stock_dropshipping_inter_company when drop shipping is installed Refactor purchase_sale_inter_company to allow inheritance
1 parent 003cac0 commit b85f94b

File tree

12 files changed

+613
-12
lines changed

12 files changed

+613
-12
lines changed

account_invoice_inter_company/tests/test_inter_company_invoice.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ def setUpClass(cls):
3434
}
3535
)
3636
cls.chart.try_loading(company=cls.company_a, install_demo=False)
37-
cls.partner_company_a = cls.env["res.partner"].create(
38-
{"name": cls.company_a.name, "is_company": True}
39-
)
40-
cls.company_a.partner_id = cls.partner_company_a
37+
cls.partner_company_a = cls.company_a.partner_id
4138
cls.company_b = cls.env["res.company"].create(
4239
{
4340
"name": "Company B",
@@ -49,9 +46,7 @@ def setUpClass(cls):
4946
}
5047
)
5148
cls.chart.try_loading(company=cls.company_b, install_demo=False)
52-
cls.partner_company_b = cls.env["res.partner"].create(
53-
{"name": cls.company_b.name, "is_company": True}
54-
)
49+
cls.partner_company_b = cls.company_b.partner_id
5550
cls.child_partner_company_b = cls.env["res.partner"].create(
5651
{
5752
"name": "Child, Company B",
@@ -60,8 +55,6 @@ def setUpClass(cls):
6055
"parent_id": cls.partner_company_b.id,
6156
}
6257
)
63-
cls.company_b.partner_id = cls.partner_company_b
64-
# cls.partner_company_b = cls.company_b.parent_id.partner_id
6558
cls.user_company_a = cls.env["res.users"].create(
6659
{
6760
"name": "User A",

purchase_sale_inter_company/tests/test_inter_company_purchase_sale.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212

1313

14-
class TestPurchaseSaleInterCompany(TestAccountInvoiceInterCompanyBase):
14+
class TestPurchaseSaleInterCompanyBase(TestAccountInvoiceInterCompanyBase):
1515
@classmethod
1616
def _configure_user(cls, user):
1717
for xml in [
@@ -53,12 +53,13 @@ def setUpClass(cls):
5353
# if product_multi_company is installed
5454
if "company_ids" in cls.env["product.template"]._fields:
5555
# We have to do that because the default method added a company
56+
cls.product.company_ids = False
5657
cls.service_product_2.company_ids = False
5758

5859
if "company_ids" in cls.env["res.partner"]._fields:
5960
# We have to do that because the default method added a company
60-
cls.partner_company_a.company_ids = [(6, 0, cls.company_a.ids)]
61-
cls.partner_company_b.company_ids = [(6, 0, cls.company_b.ids)]
61+
cls.partner_company_a.company_ids = False
62+
cls.partner_company_b.company_ids = False
6263

6364
# Configure Company B (the supplier)
6465
cls.company_b.so_from_po = True
@@ -89,6 +90,8 @@ def _approve_po(self):
8990
.search([("auto_purchase_order_id", "=", self.purchase_company_a.id)])
9091
)
9192

93+
94+
class TestPurchaseSaleInterCompany(TestPurchaseSaleInterCompanyBase):
9295
def test_purchase_sale_inter_company(self):
9396
self.purchase_company_a.notes = "Test note"
9497
sale = self._approve_po()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../test_purchase_sale_stock_dropshipping_inter_company
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
=================================================================================
2+
Test Inter Company Module from Purchase to Sale Order with Warehouse and Dropship
3+
=================================================================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:06f08f9f770c6fa70a6c80e1adbff5eea334313523e5def11b963a7c74715a31
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmulti--company-lightgray.png?logo=github
20+
:target: https://github.com/OCA/multi-company/tree/16.0/test_purchase_sale_stock_dropshipping_inter_company
21+
:alt: OCA/multi-company
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/multi-company-16-0/multi-company-16-0-test_purchase_sale_stock_dropshipping_inter_company
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/multi-company&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This addon is not meant to be installed, except for running the tests.
32+
33+
The basic tests are integrated within the ``purchase_sale_stock_inter_company`` addon.
34+
This addon extends tests to Drop Shipping
35+
36+
**Table of contents**
37+
38+
.. contents::
39+
:local:
40+
41+
Bug Tracker
42+
===========
43+
44+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/multi-company/issues>`_.
45+
In case of trouble, please check there if your issue has already been reported.
46+
If you spotted it first, help us to smash it by providing a detailed and welcomed
47+
`feedback <https://github.com/OCA/multi-company/issues/new?body=module:%20test_purchase_sale_stock_dropshipping_inter_company%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
48+
49+
Do not contact contributors directly about support or help with technical issues.
50+
51+
Credits
52+
=======
53+
54+
Maintainers
55+
~~~~~~~~~~~
56+
57+
This module is maintained by the OCA.
58+
59+
.. image:: https://odoo-community.org/logo.png
60+
:alt: Odoo Community Association
61+
:target: https://odoo-community.org
62+
63+
OCA, or the Odoo Community Association, is a nonprofit organization whose
64+
mission is to support the collaborative development of Odoo features and
65+
promote its widespread use.
66+
67+
This module is part of the `OCA/multi-company <https://github.com/OCA/multi-company/tree/16.0/test_purchase_sale_stock_dropshipping_inter_company>`_ project on GitHub.
68+
69+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (c) 2024 Groupe Voltaire
2+
# @author Guillaume MASSON <[email protected]>
3+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2024 Groupe Voltaire
2+
# @author Guillaume MASSON <[email protected]>
3+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4+
5+
{
6+
"name": "Test Inter Company Module from Purchase to Sale Order with Warehouse and Dropship",
7+
"summary": "Test Inter Company PO/SO rules with Warehouse and Drop Shipping",
8+
"version": "16.0.1.0.0",
9+
"category": "Hidden/Tests",
10+
"website": "https://github.com/OCA/multi-company",
11+
"author": "Odoo Community Association (OCA)",
12+
"license": "AGPL-3",
13+
"installable": True,
14+
"auto_install": False,
15+
"depends": ["purchase_sale_stock_inter_company", "stock_dropshipping"],
16+
"data": [],
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This addon is not meant to be installed, except for running the tests.
2+
3+
The basic tests are integrated within the ``purchase_sale_stock_inter_company`` addon.
4+
This addon extends tests to Drop Shipping
Loading

0 commit comments

Comments
 (0)