Skip to content

Commit b21e600

Browse files
committed
FIX product_logistics_uom: exclude with product_dimension module
1 parent f15ff98 commit b21e600

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

.copier-answers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ odoo_test_flavor: Both
1717
odoo_version: 18.0
1818
org_name: Odoo Community Association (OCA)
1919
org_slug: OCA
20-
rebel_module_groups: []
20+
rebel_module_groups:
21+
- product_logistics_uom
2122
repo_description: product-attribute
2223
repo_name: product-attribute
2324
repo_slug: product-attribute

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,19 @@ jobs:
3636
matrix:
3737
include:
3838
- container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest
39+
include: "product_logistics_uom"
3940
name: test with Odoo
4041
- container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest
42+
include: "product_logistics_uom"
4143
name: test with OCB
4244
makepot: "true"
45+
- container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest
46+
exclude: "product_logistics_uom"
47+
name: test with Odoo exclude
48+
- container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest
49+
exclude: "product_logistics_uom"
50+
name: test with OCB exclude
51+
makepot: "true"
4352
services:
4453
postgres:
4554
image: postgres:12
@@ -50,6 +59,8 @@ jobs:
5059
ports:
5160
- 5432:5432
5261
env:
62+
INCLUDE: "${{ matrix.include }}"
63+
EXCLUDE: "${{ matrix.exclude }}"
5364
OCA_ENABLE_CHECKLOG_ODOO: "1"
5465
steps:
5566
- uses: actions/checkout@v4

product_logistics_uom/README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,18 @@ Authors
112112
Contributors
113113
------------
114114

115-
- Raphaël Reverdy <raphael.reverdy@akretion.com>
116-
- Fernando La Chica <fernandolachica@gmail.com>
117-
- Laurent Mignon <laurent.mignon@acsone.eu>
118-
- Nhan Tran <nhant@trobz.com>
115+
- Raphaël Reverdy <raphael.reverdy@akretion.com>
116+
- Fernando La Chica <fernandolachica@gmail.com>
117+
- Laurent Mignon <laurent.mignon@acsone.eu>
118+
- Nhan Tran <nhant@trobz.com>
119119

120120
Other credits
121121
-------------
122122

123123
The development of this module has been financially supported by:
124124

125-
- Akretion <https://akretion.com>
126-
- La Base <https://labase.coop>
125+
- Akretion <https://akretion.com>
126+
- La Base <https://labase.coop>
127127

128128
Maintainers
129129
-----------

product_logistics_uom/__manifest__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"depends": [
1515
"product",
1616
],
17+
"excludes": [
18+
"product_dimension",
19+
],
1720
"data": [
1821
"views/res_config_settings.xml",
1922
"views/product.xml",

product_logistics_uom/tests/test_product_logistics_uom.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
33

44

5-
from unittest.mock import patch
6-
75
from odoo.tests.common import TransactionCase
86

97

@@ -61,19 +59,10 @@ def test_template_volume(self):
6159
template = self.product.product_tmpl_id
6260
template.volume_uom_id = self.volume_uom_l
6361
# Volume calculation from product_dimension module has compatibility issue.
64-
with patch(
65-
"odoo.addons.product_dimension.models.product_template.ProductTemplate._calc_volume",
66-
return_value=1,
67-
):
68-
template.volume = 1
69-
self.assertEqual(template.product_volume, 1000)
70-
71-
with patch(
72-
"odoo.addons.product_dimension.models.product_template.ProductTemplate._calc_volume",
73-
return_value=0.01,
74-
):
75-
template.product_volume = 10
76-
self.assertEqual(template.volume, 0.01)
62+
template.volume = 1
63+
self.assertEqual(template.product_volume, 1000)
64+
template.product_volume = 10
65+
self.assertEqual(template.volume, 0.01)
7766
template.volume_uom_id = self.volume_uom_m3
7867
self.assertEqual(template.product_volume, template.volume)
7968

@@ -120,11 +109,7 @@ def test_template_with_variant(self):
120109
self.assertFalse(template.show_weight_uom_warning) # for coverage
121110
variant.unlink()
122111
# Volume calculation from product_dimension module has compatibility issue.
123-
with patch(
124-
"odoo.addons.product_dimension.models.product_template.ProductTemplate._calc_volume",
125-
return_value=10.0,
126-
):
127-
self.assertEqual(template.volume, 10.0)
112+
self.assertEqual(template.volume, 10.0)
128113
self.assertEqual(template.weight, 10.0)
129114
self.assertEqual(template.product_volume, 10.0)
130115
self.assertEqual(template.product_weight, 10.0)

0 commit comments

Comments
 (0)