odoo-addon-base-territory 17.0.1.0.0.3__py3-none-any.whl → 18.0.1.0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/base_territory/README.rst +6 -6
- odoo/addons/base_territory/__manifest__.py +1 -1
- odoo/addons/base_territory/i18n/base_territory.pot +1 -1
- odoo/addons/base_territory/static/description/index.html +11 -9
- odoo/addons/base_territory/tests/__init__.py +5 -0
- odoo/addons/base_territory/tests/test_res_branch.py +46 -0
- odoo/addons/base_territory/tests/test_res_country.py +58 -0
- odoo/addons/base_territory/tests/test_res_district.py +57 -0
- odoo/addons/base_territory/tests/test_res_region.py +52 -0
- odoo/addons/base_territory/tests/test_res_territory.py +84 -0
- odoo/addons/base_territory/views/res_branch.xml +3 -3
- odoo/addons/base_territory/views/res_country.xml +2 -2
- odoo/addons/base_territory/views/res_district.xml +3 -3
- odoo/addons/base_territory/views/res_region.xml +3 -3
- odoo/addons/base_territory/views/res_territory.xml +3 -3
- {odoo_addon_base_territory-17.0.1.0.0.3.dist-info → odoo_addon_base_territory-18.0.1.0.0.2.dist-info}/METADATA +9 -9
- {odoo_addon_base_territory-17.0.1.0.0.3.dist-info → odoo_addon_base_territory-18.0.1.0.0.2.dist-info}/RECORD +19 -13
- {odoo_addon_base_territory-17.0.1.0.0.3.dist-info → odoo_addon_base_territory-18.0.1.0.0.2.dist-info}/WHEEL +1 -1
- {odoo_addon_base_territory-17.0.1.0.0.3.dist-info → odoo_addon_base_territory-18.0.1.0.0.2.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ Base Territory
|
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
8
|
!! changes will be overwritten. !!
|
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
10
|
+
!! source digest: sha256:fa72f0cf7de32281457e66e62644b33263d8294b9d1bcbf760a7b3056f28b23c
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
|
@@ -17,13 +17,13 @@ Base Territory
|
|
|
17
17
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
18
18
|
:alt: License: AGPL-3
|
|
19
19
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github
|
|
20
|
-
:target: https://github.com/OCA/field-service/tree/
|
|
20
|
+
:target: https://github.com/OCA/field-service/tree/18.0/base_territory
|
|
21
21
|
:alt: OCA/field-service
|
|
22
22
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
23
|
-
:target: https://translation.odoo-community.org/projects/field-service-
|
|
23
|
+
:target: https://translation.odoo-community.org/projects/field-service-18-0/field-service-18-0-base_territory
|
|
24
24
|
:alt: Translate me on Weblate
|
|
25
25
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
26
|
-
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=
|
|
26
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=18.0
|
|
27
27
|
:alt: Try me on Runboat
|
|
28
28
|
|
|
29
29
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
@@ -51,7 +51,7 @@ Bug Tracker
|
|
|
51
51
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/issues>`_.
|
|
52
52
|
In case of trouble, please check there if your issue has already been reported.
|
|
53
53
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
54
|
-
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20base_territory%0Aversion:%
|
|
54
|
+
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20base_territory%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
55
55
|
|
|
56
56
|
Do not contact contributors directly about support or help with technical issues.
|
|
57
57
|
|
|
@@ -101,6 +101,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|
|
|
101
101
|
|
|
102
102
|
|maintainer-max3903| |maintainer-brian10048|
|
|
103
103
|
|
|
104
|
-
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/
|
|
104
|
+
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/18.0/base_territory>`_ project on GitHub.
|
|
105
105
|
|
|
106
106
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Base Territory",
|
|
6
6
|
"summary": "This module allows you to define territories, branches,"
|
|
7
7
|
" districts and regions to be used for Field Service operations or Sales.",
|
|
8
|
-
"version": "
|
|
8
|
+
"version": "18.0.1.0.0",
|
|
9
9
|
"category": "Hidden",
|
|
10
10
|
"author": "Open Source Integrators, Odoo Community Association (OCA)",
|
|
11
11
|
"website": "https://github.com/OCA/field-service",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
3
|
<head>
|
|
@@ -9,10 +8,11 @@
|
|
|
9
8
|
|
|
10
9
|
/*
|
|
11
10
|
:Author: David Goodger (goodger@python.org)
|
|
12
|
-
:Id: $Id: html4css1.css
|
|
11
|
+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
|
13
12
|
:Copyright: This stylesheet has been placed in the public domain.
|
|
14
13
|
|
|
15
14
|
Default cascading style sheet for the HTML output of Docutils.
|
|
15
|
+
Despite the name, some widely supported CSS2 features are used.
|
|
16
16
|
|
|
17
17
|
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
|
18
18
|
customize this style sheet.
|
|
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
|
275
275
|
margin-left: 2em ;
|
|
276
276
|
margin-right: 2em }
|
|
277
277
|
|
|
278
|
-
pre.code .ln { color:
|
|
278
|
+
pre.code .ln { color: gray; } /* line numbers */
|
|
279
279
|
pre.code, code { background-color: #eeeeee }
|
|
280
280
|
pre.code .comment, code .comment { color: #5C6576 }
|
|
281
281
|
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
@@ -301,7 +301,7 @@ span.option {
|
|
|
301
301
|
span.pre {
|
|
302
302
|
white-space: pre }
|
|
303
303
|
|
|
304
|
-
span.problematic {
|
|
304
|
+
span.problematic, pre.problematic {
|
|
305
305
|
color: red }
|
|
306
306
|
|
|
307
307
|
span.section-subtitle {
|
|
@@ -367,9 +367,9 @@ ul.auto-toc {
|
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
368
|
!! changes will be overwritten. !!
|
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
370
|
+
!! source digest: sha256:fa72f0cf7de32281457e66e62644b33263d8294b9d1bcbf760a7b3056f28b23c
|
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
372
|
-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/field-service/tree/
|
|
372
|
+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/field-service/tree/18.0/base_territory"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/field-service-18-0/field-service-18-0-base_territory"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
373
|
<p>This module allows you to define territories, branches, districts and
|
|
374
374
|
regions to be used for Field Service operations or Sales.</p>
|
|
375
375
|
<p><strong>Table of contents</strong></p>
|
|
@@ -400,7 +400,7 @@ respective manager.</li>
|
|
|
400
400
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/field-service/issues">GitHub Issues</a>.
|
|
401
401
|
In case of trouble, please check there if your issue has already been reported.
|
|
402
402
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
403
|
-
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20base_territory%0Aversion:%
|
|
403
|
+
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20base_territory%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
404
404
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
405
405
|
</div>
|
|
406
406
|
<div class="section" id="credits">
|
|
@@ -429,13 +429,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|
|
429
429
|
<div class="section" id="maintainers">
|
|
430
430
|
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
|
|
431
431
|
<p>This module is maintained by the OCA.</p>
|
|
432
|
-
<a class="reference external image-reference" href="https://odoo-community.org"
|
|
432
|
+
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
433
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
434
|
+
</a>
|
|
433
435
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
434
436
|
mission is to support the collaborative development of Odoo features and
|
|
435
437
|
promote its widespread use.</p>
|
|
436
438
|
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
|
|
437
439
|
<p><a class="reference external image-reference" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/brian10048"><img alt="brian10048" src="https://github.com/brian10048.png?size=40px" /></a></p>
|
|
438
|
-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/
|
|
440
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/18.0/base_territory">OCA/field-service</a> project on GitHub.</p>
|
|
439
441
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
|
440
442
|
</div>
|
|
441
443
|
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from odoo.tests.common import TransactionCase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TestResBranch(TransactionCase):
|
|
5
|
+
@classmethod
|
|
6
|
+
def setUpClass(cls):
|
|
7
|
+
super().setUpClass()
|
|
8
|
+
|
|
9
|
+
cls.partner = cls.env["res.partner"].create(
|
|
10
|
+
{"name": "Test Partner", "email": "test_partner@example.com"}
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
cls.district = cls.env["res.district"].create({"name": "Test District"})
|
|
14
|
+
|
|
15
|
+
def create_branch(self, **kwargs):
|
|
16
|
+
return self.env["res.branch"].create(
|
|
17
|
+
{
|
|
18
|
+
"name": "Test Branch",
|
|
19
|
+
"partner_id": self.partner.id,
|
|
20
|
+
"district_id": self.district.id,
|
|
21
|
+
**kwargs,
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def test_create_branch(self):
|
|
26
|
+
branch = self.create_branch(description="Main Branch")
|
|
27
|
+
self.assertEqual(branch.name, "Test Branch", "Branch name mismatch")
|
|
28
|
+
self.assertEqual(branch.partner_id, self.partner, "Branch partner mismatch")
|
|
29
|
+
self.assertEqual(branch.district_id, self.district, "Branch district mismatch")
|
|
30
|
+
self.assertEqual(
|
|
31
|
+
branch.description, "Main Branch", "Branch description mismatch"
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
def test_update_branch(self):
|
|
35
|
+
branch = self.create_branch()
|
|
36
|
+
branch.write({"name": "Updated Branch"})
|
|
37
|
+
self.assertEqual(branch.name, "Updated Branch", "Branch name was not updated")
|
|
38
|
+
|
|
39
|
+
def test_unlink_branch(self):
|
|
40
|
+
branch = self.create_branch()
|
|
41
|
+
branch_id = branch.id
|
|
42
|
+
branch.unlink()
|
|
43
|
+
self.assertFalse(
|
|
44
|
+
self.env["res.branch"].search([("id", "=", branch_id)]),
|
|
45
|
+
"Branch was not deleted",
|
|
46
|
+
)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from odoo.tests.common import TransactionCase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TestResCountry(TransactionCase):
|
|
5
|
+
@classmethod
|
|
6
|
+
def setUpClass(cls):
|
|
7
|
+
super().setUpClass()
|
|
8
|
+
|
|
9
|
+
cls.territory = cls.env["res.territory"].create({"name": "Test Territory"})
|
|
10
|
+
cls.region1 = cls.env["res.region"].create({"name": "Test Region 1"})
|
|
11
|
+
cls.region2 = cls.env["res.region"].create({"name": "Test Region 2"})
|
|
12
|
+
|
|
13
|
+
cls.country = cls.env["res.country"].create(
|
|
14
|
+
{
|
|
15
|
+
"name": "Test Country",
|
|
16
|
+
"code": "TE",
|
|
17
|
+
"territory_id": cls.territory.id,
|
|
18
|
+
"region_ids": [(6, 0, [cls.region1.id, cls.region2.id])],
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def test_create_country(self):
|
|
23
|
+
self.assertEqual(self.country.name, "Test Country", "Country name mismatch")
|
|
24
|
+
self.assertEqual(self.country.code, "TE", "Country code mismatch")
|
|
25
|
+
self.assertEqual(
|
|
26
|
+
self.country.territory_id, self.territory, "Country territory mismatch"
|
|
27
|
+
)
|
|
28
|
+
self.assertIn(
|
|
29
|
+
self.region1, self.country.region_ids, "Region 1 not correctly linked"
|
|
30
|
+
)
|
|
31
|
+
self.assertIn(
|
|
32
|
+
self.region2, self.country.region_ids, "Region 2 not correctly linked"
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
def test_update_country_territory(self):
|
|
36
|
+
new_territory = self.env["res.territory"].create({"name": "New Territory"})
|
|
37
|
+
self.country.write({"territory_id": new_territory.id})
|
|
38
|
+
self.assertEqual(
|
|
39
|
+
self.country.territory_id, new_territory, "Territory was not updated"
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def test_update_country_regions(self):
|
|
43
|
+
new_region = self.env["res.region"].create({"name": "Test Region 3"})
|
|
44
|
+
self.country.write({"region_ids": [(6, 0, [new_region.id])]})
|
|
45
|
+
self.assertEqual(
|
|
46
|
+
len(self.country.region_ids), 1, "Region count after update is incorrect"
|
|
47
|
+
)
|
|
48
|
+
self.assertIn(
|
|
49
|
+
new_region, self.country.region_ids, "New region was not added correctly"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def test_unlink_country(self):
|
|
53
|
+
country_id = self.country.id
|
|
54
|
+
self.country.unlink()
|
|
55
|
+
self.assertFalse(
|
|
56
|
+
self.env["res.country"].search([("id", "=", country_id)]),
|
|
57
|
+
"Country was not deleted",
|
|
58
|
+
)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from odoo.tests.common import TransactionCase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TestResDistrict(TransactionCase):
|
|
5
|
+
@classmethod
|
|
6
|
+
def setUpClass(cls):
|
|
7
|
+
super().setUpClass()
|
|
8
|
+
|
|
9
|
+
cls.region = cls.env["res.region"].create({"name": "Test Region"})
|
|
10
|
+
cls.partner = cls.env["res.partner"].create({"name": "Test District Manager"})
|
|
11
|
+
|
|
12
|
+
cls.district = cls.env["res.district"].create(
|
|
13
|
+
{
|
|
14
|
+
"name": "Test District",
|
|
15
|
+
"region_id": cls.region.id,
|
|
16
|
+
"partner_id": cls.partner.id,
|
|
17
|
+
"description": "Test District Description",
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def test_create_district(self):
|
|
22
|
+
self.assertEqual(self.district.name, "Test District", "District name mismatch")
|
|
23
|
+
self.assertEqual(
|
|
24
|
+
self.district.region_id, self.region, "District region mismatch"
|
|
25
|
+
)
|
|
26
|
+
self.assertEqual(
|
|
27
|
+
self.district.partner_id, self.partner, "District manager mismatch"
|
|
28
|
+
)
|
|
29
|
+
self.assertEqual(
|
|
30
|
+
self.district.description,
|
|
31
|
+
"Test District Description",
|
|
32
|
+
"District description mismatch",
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
def test_update_district_region(self):
|
|
36
|
+
new_region = self.env["res.region"].create({"name": "New Region"})
|
|
37
|
+
self.district.write({"region_id": new_region.id})
|
|
38
|
+
self.assertEqual(
|
|
39
|
+
self.district.region_id, new_region, "Region was not updated correctly"
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def test_update_district_manager(self):
|
|
43
|
+
new_partner = self.env["res.partner"].create({"name": "New District Manager"})
|
|
44
|
+
self.district.write({"partner_id": new_partner.id})
|
|
45
|
+
self.assertEqual(
|
|
46
|
+
self.district.partner_id,
|
|
47
|
+
new_partner,
|
|
48
|
+
"District manager was not updated correctly",
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
def test_unlink_district(self):
|
|
52
|
+
district_id = self.district.id
|
|
53
|
+
self.district.unlink()
|
|
54
|
+
self.assertFalse(
|
|
55
|
+
self.env["res.district"].search([("id", "=", district_id)]),
|
|
56
|
+
"District was not deleted",
|
|
57
|
+
)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from odoo.tests.common import TransactionCase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TestResRegion(TransactionCase):
|
|
5
|
+
@classmethod
|
|
6
|
+
def setUpClass(cls):
|
|
7
|
+
super().setUpClass()
|
|
8
|
+
|
|
9
|
+
cls.partner = cls.env["res.partner"].create({"name": "Test Region Manager"})
|
|
10
|
+
|
|
11
|
+
cls.region = cls.env["res.region"].create(
|
|
12
|
+
{
|
|
13
|
+
"name": "Test Region",
|
|
14
|
+
"description": "Test Region Description",
|
|
15
|
+
"partner_id": cls.partner.id,
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
def test_create_region(self):
|
|
20
|
+
self.assertEqual(self.region.name, "Test Region", "Region name mismatch")
|
|
21
|
+
self.assertEqual(
|
|
22
|
+
self.region.description,
|
|
23
|
+
"Test Region Description",
|
|
24
|
+
"Region description mismatch",
|
|
25
|
+
)
|
|
26
|
+
self.assertEqual(
|
|
27
|
+
self.region.partner_id, self.partner, "Region manager mismatch"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
def test_update_region_name(self):
|
|
31
|
+
new_name = "Updated Region Name"
|
|
32
|
+
self.region.write({"name": new_name})
|
|
33
|
+
self.assertEqual(
|
|
34
|
+
self.region.name, new_name, "Region name was not updated correctly"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def test_update_region_manager(self):
|
|
38
|
+
new_partner = self.env["res.partner"].create({"name": "New Region Manager"})
|
|
39
|
+
self.region.write({"partner_id": new_partner.id})
|
|
40
|
+
self.assertEqual(
|
|
41
|
+
self.region.partner_id,
|
|
42
|
+
new_partner,
|
|
43
|
+
"Region manager was not updated correctly",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def test_unlink_region(self):
|
|
47
|
+
region_id = self.region.id
|
|
48
|
+
self.region.unlink()
|
|
49
|
+
self.assertFalse(
|
|
50
|
+
self.env["res.region"].search([("id", "=", region_id)]),
|
|
51
|
+
"Region was not deleted",
|
|
52
|
+
)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from odoo.tests.common import TransactionCase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TestResTerritory(TransactionCase):
|
|
5
|
+
@classmethod
|
|
6
|
+
def setUpClass(cls):
|
|
7
|
+
super().setUpClass()
|
|
8
|
+
|
|
9
|
+
cls.partner = cls.env["res.partner"].create({"name": "Test Branch Manager"})
|
|
10
|
+
|
|
11
|
+
cls.region = cls.env["res.region"].create(
|
|
12
|
+
{
|
|
13
|
+
"name": "Test Region",
|
|
14
|
+
"description": "Test Region Description",
|
|
15
|
+
"partner_id": cls.partner.id,
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
cls.district = cls.env["res.district"].create(
|
|
20
|
+
{
|
|
21
|
+
"name": "Test District",
|
|
22
|
+
"region_id": cls.region.id,
|
|
23
|
+
"partner_id": cls.partner.id,
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
cls.branch = cls.env["res.branch"].create(
|
|
28
|
+
{
|
|
29
|
+
"name": "Test Branch",
|
|
30
|
+
"partner_id": cls.partner.id,
|
|
31
|
+
"district_id": cls.district.id,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
cls.territory = cls.env["res.territory"].create(
|
|
36
|
+
{
|
|
37
|
+
"name": "Test Territory",
|
|
38
|
+
"branch_id": cls.branch.id,
|
|
39
|
+
"description": "Test Territory Description",
|
|
40
|
+
"type": "state",
|
|
41
|
+
"zip_codes": "12345, 67890",
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
def test_create_territory(self):
|
|
46
|
+
self.assertEqual(
|
|
47
|
+
self.territory.name, "Test Territory", "Territory name mismatch"
|
|
48
|
+
)
|
|
49
|
+
self.assertEqual(
|
|
50
|
+
self.territory.description,
|
|
51
|
+
"Test Territory Description",
|
|
52
|
+
"Territory description mismatch",
|
|
53
|
+
)
|
|
54
|
+
self.assertEqual(self.territory.branch_id, self.branch, "Branch mismatch")
|
|
55
|
+
self.assertEqual(self.territory.district_id, self.district, "District mismatch")
|
|
56
|
+
self.assertEqual(self.territory.region_id, self.region, "Region mismatch")
|
|
57
|
+
self.assertEqual(self.territory.type, "state", "Territory type mismatch")
|
|
58
|
+
self.assertEqual(self.territory.zip_codes, "12345, 67890", "ZIP codes mismatch")
|
|
59
|
+
|
|
60
|
+
def test_update_territory(self):
|
|
61
|
+
new_branch = self.env["res.branch"].create({"name": "New Test Branch"})
|
|
62
|
+
self.territory.write({"branch_id": new_branch.id, "type": "zip"})
|
|
63
|
+
self.assertEqual(
|
|
64
|
+
self.territory.branch_id, new_branch, "Branch was not updated correctly"
|
|
65
|
+
)
|
|
66
|
+
self.assertEqual(
|
|
67
|
+
self.territory.type, "zip", "Territory type was not updated correctly"
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def test_add_country_to_territory(self):
|
|
71
|
+
country = self.env["res.country"].create(
|
|
72
|
+
{"name": "Test Country", "territory_id": self.territory.id, "code": "TS"}
|
|
73
|
+
)
|
|
74
|
+
self.assertIn(
|
|
75
|
+
country, self.territory.country_ids, "Country was not added to territory"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
def test_unlink_territory(self):
|
|
79
|
+
territory_id = self.territory.id
|
|
80
|
+
self.territory.unlink()
|
|
81
|
+
self.assertFalse(
|
|
82
|
+
self.env["res.territory"].search([("id", "=", territory_id)]),
|
|
83
|
+
"Territory was not deleted",
|
|
84
|
+
)
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<field name="name">res.branch.tree</field>
|
|
5
5
|
<field name="model">res.branch</field>
|
|
6
6
|
<field name="arch" type="xml">
|
|
7
|
-
<
|
|
7
|
+
<list>
|
|
8
8
|
<field name="name" />
|
|
9
9
|
<field name="district_id" />
|
|
10
|
-
</
|
|
10
|
+
</list>
|
|
11
11
|
</field>
|
|
12
12
|
</record>
|
|
13
13
|
<!-- Branch Form View -->
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
<field name="name">Branches</field>
|
|
42
42
|
<field name="res_model">res.branch</field>
|
|
43
43
|
<field name="view_id" ref="res_branch_tree_view" />
|
|
44
|
-
<field name="view_mode">
|
|
44
|
+
<field name="view_mode">list,form</field>
|
|
45
45
|
</record>
|
|
46
46
|
</odoo>
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
<field name="state_ids" position="after">
|
|
8
8
|
<label for="region_ids" />
|
|
9
9
|
<field name="region_ids">
|
|
10
|
-
<
|
|
10
|
+
<list editable="bottom">
|
|
11
11
|
<field name="name" />
|
|
12
12
|
<field name="description" />
|
|
13
13
|
<field name="partner_id" />
|
|
14
|
-
</
|
|
14
|
+
</list>
|
|
15
15
|
</field>
|
|
16
16
|
</field>
|
|
17
17
|
</field>
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<field name="name">res.district.tree</field>
|
|
5
5
|
<field name="model">res.district</field>
|
|
6
6
|
<field name="arch" type="xml">
|
|
7
|
-
<
|
|
7
|
+
<list>
|
|
8
8
|
<field name="name" />
|
|
9
9
|
<field name="region_id" />
|
|
10
|
-
</
|
|
10
|
+
</list>
|
|
11
11
|
</field>
|
|
12
12
|
</record>
|
|
13
13
|
<!-- District Form View -->
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
<field name="name">Districts</field>
|
|
42
42
|
<field name="res_model">res.district</field>
|
|
43
43
|
<field name="view_id" ref="res_district_tree_view" />
|
|
44
|
-
<field name="view_mode">
|
|
44
|
+
<field name="view_mode">list,form</field>
|
|
45
45
|
</record>
|
|
46
46
|
</odoo>
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<field name="name">res.region.tree</field>
|
|
5
5
|
<field name="model">res.region</field>
|
|
6
6
|
<field name="arch" type="xml">
|
|
7
|
-
<
|
|
7
|
+
<list>
|
|
8
8
|
<field name="name" />
|
|
9
|
-
</
|
|
9
|
+
</list>
|
|
10
10
|
</field>
|
|
11
11
|
</record>
|
|
12
12
|
<!-- Region Form View -->
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
<field name="name">Regions</field>
|
|
40
40
|
<field name="res_model">res.region</field>
|
|
41
41
|
<field name="view_id" ref="res_region_tree_view" />
|
|
42
|
-
<field name="view_mode">
|
|
42
|
+
<field name="view_mode">list,form</field>
|
|
43
43
|
</record>
|
|
44
44
|
</odoo>
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<field name="name">res.territory.tree</field>
|
|
5
5
|
<field name="model">res.territory</field>
|
|
6
6
|
<field name="arch" type="xml">
|
|
7
|
-
<
|
|
7
|
+
<list>
|
|
8
8
|
<field name="name" />
|
|
9
9
|
<field name="branch_id" />
|
|
10
|
-
</
|
|
10
|
+
</list>
|
|
11
11
|
</field>
|
|
12
12
|
</record>
|
|
13
13
|
<!-- Territory Form View -->
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
<field name="name">Territories</field>
|
|
50
50
|
<field name="res_model">res.territory</field>
|
|
51
51
|
<field name="view_id" ref="res_territory_tree_view" />
|
|
52
|
-
<field name="view_mode">
|
|
52
|
+
<field name="view_mode">list,form</field>
|
|
53
53
|
</record>
|
|
54
54
|
</odoo>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-base_territory
|
|
3
|
-
Version:
|
|
3
|
+
Version: 18.0.1.0.0.2
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
|
-
Requires-Dist: odoo
|
|
5
|
+
Requires-Dist: odoo==18.0.*
|
|
6
6
|
Summary: This module allows you to define territories, branches, districts and regions to be used for Field Service operations or Sales.
|
|
7
7
|
Home-page: https://github.com/OCA/field-service
|
|
8
8
|
License: AGPL-3
|
|
@@ -10,7 +10,7 @@ Author: Open Source Integrators, Odoo Community Association (OCA)
|
|
|
10
10
|
Author-email: support@odoo-community.org
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
12
|
Classifier: Framework :: Odoo
|
|
13
|
-
Classifier: Framework :: Odoo ::
|
|
13
|
+
Classifier: Framework :: Odoo :: 18.0
|
|
14
14
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
15
15
|
Classifier: Development Status :: 5 - Production/Stable
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@ Base Territory
|
|
|
23
23
|
!! This file is generated by oca-gen-addon-readme !!
|
|
24
24
|
!! changes will be overwritten. !!
|
|
25
25
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
26
|
-
!! source digest: sha256:
|
|
26
|
+
!! source digest: sha256:fa72f0cf7de32281457e66e62644b33263d8294b9d1bcbf760a7b3056f28b23c
|
|
27
27
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
28
28
|
|
|
29
29
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
|
|
@@ -33,13 +33,13 @@ Base Territory
|
|
|
33
33
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
34
34
|
:alt: License: AGPL-3
|
|
35
35
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github
|
|
36
|
-
:target: https://github.com/OCA/field-service/tree/
|
|
36
|
+
:target: https://github.com/OCA/field-service/tree/18.0/base_territory
|
|
37
37
|
:alt: OCA/field-service
|
|
38
38
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
39
|
-
:target: https://translation.odoo-community.org/projects/field-service-
|
|
39
|
+
:target: https://translation.odoo-community.org/projects/field-service-18-0/field-service-18-0-base_territory
|
|
40
40
|
:alt: Translate me on Weblate
|
|
41
41
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
42
|
-
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=
|
|
42
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=18.0
|
|
43
43
|
:alt: Try me on Runboat
|
|
44
44
|
|
|
45
45
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
@@ -67,7 +67,7 @@ Bug Tracker
|
|
|
67
67
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/issues>`_.
|
|
68
68
|
In case of trouble, please check there if your issue has already been reported.
|
|
69
69
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
70
|
-
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20base_territory%0Aversion:%
|
|
70
|
+
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20base_territory%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
71
71
|
|
|
72
72
|
Do not contact contributors directly about support or help with technical issues.
|
|
73
73
|
|
|
@@ -117,6 +117,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|
|
|
117
117
|
|
|
118
118
|
|maintainer-max3903| |maintainer-brian10048|
|
|
119
119
|
|
|
120
|
-
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/
|
|
120
|
+
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/18.0/base_territory>`_ project on GitHub.
|
|
121
121
|
|
|
122
122
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
odoo/addons/base_territory/README.rst,sha256=
|
|
1
|
+
odoo/addons/base_territory/README.rst,sha256=XEtyJOwxG5w4BEQd1J4nDzVJ2lES__UfFwpfLHRMZOg,3799
|
|
2
2
|
odoo/addons/base_territory/__init__.py,sha256=ZGjmXT9q1Wc3A9Eb3pRZjwDcSFijPJcJLFSMyZdyxyU,86
|
|
3
|
-
odoo/addons/base_territory/__manifest__.py,sha256=
|
|
3
|
+
odoo/addons/base_territory/__manifest__.py,sha256=BIG-LDnWhj-0npVGt1ru4Ovy1WimVnnQQcInhU2XoSs,949
|
|
4
4
|
odoo/addons/base_territory/demo/base_territory_demo.xml,sha256=vugDQxynBFKTa3YiZK7W8V0Lpm2O1GQfTEl_TTR_lGc,670
|
|
5
|
-
odoo/addons/base_territory/i18n/base_territory.pot,sha256
|
|
5
|
+
odoo/addons/base_territory/i18n/base_territory.pot,sha256=-GxhRnbiRICJ--NAu87HBr4o3G4HEP5SibZM3fILXXM,7205
|
|
6
6
|
odoo/addons/base_territory/i18n/es.po,sha256=DkCfKBJu0p6PcUeJoyXGnNHtoTQJJLMYgbj1E3e2ozQ,7765
|
|
7
7
|
odoo/addons/base_territory/i18n/es_AR.po,sha256=tPPqTYsp7owjOfJhc_aQSwFsspttUDYQoMAeeL3BfPM,7742
|
|
8
8
|
odoo/addons/base_territory/i18n/it.po,sha256=xtKdO7MRQdi4nEyGv0dGoPhGHOi32ezYIyqGnL-R4Js,7697
|
|
@@ -20,14 +20,20 @@ odoo/addons/base_territory/readme/DESCRIPTION.md,sha256=i24k7R3zm7uw6ZYM6Z9oyte6
|
|
|
20
20
|
odoo/addons/base_territory/readme/USAGE.md,sha256=gD6x2RGc5izPl3CnyVQPgMbiBlP9BHn17PYk6WSooW0,170
|
|
21
21
|
odoo/addons/base_territory/security/ir.model.access.csv,sha256=-LOTxznuXa5xP2wg2Ac6Rc00xAmcGxhO5q1kAyHC47k,396
|
|
22
22
|
odoo/addons/base_territory/static/description/icon.png,sha256=yx9-4jnAq3PdVf27mtFBnFWAcJVD0ElJEk1EHeT_-s0,17808
|
|
23
|
-
odoo/addons/base_territory/static/description/index.html,sha256=
|
|
23
|
+
odoo/addons/base_territory/static/description/index.html,sha256=5QnDnVz0AUKPYSQV0XqLgpYJVZzSZVL3oYx13jG74ds,13882
|
|
24
|
+
odoo/addons/base_territory/tests/__init__.py,sha256=BHPnFTVHHXTJnvk3lu5tXoQjRcZfCCrXM6-GbMrg2HY,156
|
|
25
|
+
odoo/addons/base_territory/tests/test_res_branch.py,sha256=J-Eakfwgth61EObQ5roYEP4rZcaa_Qs-SMYyJO777HI,1602
|
|
26
|
+
odoo/addons/base_territory/tests/test_res_country.py,sha256=jW5Vxk1tAt0zolepkheiG1l09Pxhpzj_XTwEW2vC7Gs,2226
|
|
27
|
+
odoo/addons/base_territory/tests/test_res_district.py,sha256=otLk9U5T5Wzmz3xVq_8dmmT_sb8QFISiTUQo5wmAOtI,2024
|
|
28
|
+
odoo/addons/base_territory/tests/test_res_region.py,sha256=pd7GxNnlNxk_j3NYgWKjow7Px-H25uskX_S0enDe2RA,1684
|
|
29
|
+
odoo/addons/base_territory/tests/test_res_territory.py,sha256=Hod_EKINZL1b4DXhWqA-mdcwPk9L215PpMUA333re5w,2995
|
|
24
30
|
odoo/addons/base_territory/views/menu.xml,sha256=SEFvRgJu_vVHOPchOHZ8adX_PI7Ez7peXrhx9iYGYUU,684
|
|
25
|
-
odoo/addons/base_territory/views/res_branch.xml,sha256=
|
|
26
|
-
odoo/addons/base_territory/views/res_country.xml,sha256=
|
|
27
|
-
odoo/addons/base_territory/views/res_district.xml,sha256
|
|
28
|
-
odoo/addons/base_territory/views/res_region.xml,sha256
|
|
29
|
-
odoo/addons/base_territory/views/res_territory.xml,sha256=
|
|
30
|
-
odoo_addon_base_territory-
|
|
31
|
-
odoo_addon_base_territory-
|
|
32
|
-
odoo_addon_base_territory-
|
|
33
|
-
odoo_addon_base_territory-
|
|
31
|
+
odoo/addons/base_territory/views/res_branch.xml,sha256=v3EyIglqsUWVVakT-Us9EE_gCoBjAF092KI5Rnb3jYw,1684
|
|
32
|
+
odoo/addons/base_territory/views/res_country.xml,sha256=Evz_EC51u_BxJcYonfCz5PLonCEm8LFn8A6WRz7frcA,755
|
|
33
|
+
odoo/addons/base_territory/views/res_district.xml,sha256=G8S9V9CBaXuOD3HjxBOGdIaZRd3BegWVLVBHlji5dwA,1705
|
|
34
|
+
odoo/addons/base_territory/views/res_region.xml,sha256=-fvuIFEkeLi6_XxhFAHPZ50Vv3bh_MVCZMqNWAALbmg,1581
|
|
35
|
+
odoo/addons/base_territory/views/res_territory.xml,sha256=iBWJCRtETKRX7i0OUUqYphswNcFpHAze1hRIGH_OqTw,2070
|
|
36
|
+
odoo_addon_base_territory-18.0.1.0.0.2.dist-info/METADATA,sha256=iP5p2GTGfVJiBT6MWDkJJL39di5WGTd3FCv6L4eeBKc,4479
|
|
37
|
+
odoo_addon_base_territory-18.0.1.0.0.2.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
|
|
38
|
+
odoo_addon_base_territory-18.0.1.0.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
|
39
|
+
odoo_addon_base_territory-18.0.1.0.0.2.dist-info/RECORD,,
|
|
File without changes
|