Files
Simone Orsi 5d44d558f6 s_packaging_calculator: add product_qty_by_packaging_as_str
Retrieve quickly packagin bty qty as a string.
2021-09-14 04:18:03 +00:00

43 lines
1.3 KiB
Python

# Copyright 2020 Camptocamp SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
from odoo.tests import SavepointCase
class TestCommon(SavepointCase):
at_install = False
post_install = True
maxDiff = None
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.uom_unit = cls.env.ref("uom.product_uom_unit")
cls.product_a = cls.env["product.product"].create(
{
"name": "Product A",
"uom_id": cls.uom_unit.id,
"uom_po_id": cls.uom_unit.id,
}
)
cls.pkg_box = cls.env["product.packaging"].create(
{"name": "Box", "product_id": cls.product_a.id, "qty": 50, "barcode": "BOX"}
)
cls.pkg_big_box = cls.env["product.packaging"].create(
{
"name": "Big Box",
"product_id": cls.product_a.id,
"qty": 200,
"barcode": "BIGBOX",
}
)
cls.pkg_pallet = cls.env["product.packaging"].create(
{
"name": "Pallet",
"product_id": cls.product_a.id,
"qty": 2000,
"barcode": "PALLET",
}
)