forked from OCA/stock-logistics-workflow
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] product_dimension: Allow to create product template with dimens…
…ions
- Loading branch information
1 parent
08cccaf
commit 36e6216
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from . import test_compute_volume | ||
from . import test_compute_volume, test_template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2022 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestTemplateValues(TransactionCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
|
||
cls.product_template = cls.env["product.template"].create( | ||
{ | ||
"name": "Unittest P1", | ||
"product_length": 10.0, | ||
"product_width": 5.0, | ||
"product_height": 3.0, | ||
"uom_id": cls.env.ref("uom.product_uom_unit").id, | ||
"type": "consu", | ||
} | ||
) | ||
|
||
def test_template(self): | ||
""" | ||
Data: | ||
one product template with dimensions | ||
Test Case: | ||
get the product associated to the product_template and | ||
check that the length, width and height | ||
are the same as for the product template | ||
Expected result: | ||
length, width, height are the same on the product and product template | ||
""" | ||
|
||
product = self.product_template.product_variant_ids | ||
|
||
self.assertEqual(product.product_length, 10.0) | ||
self.assertEqual(product.product_width, 5.0) | ||
self.assertEqual(product.product_height, 3.0) |