diff --git a/setup/stock_production_lot_warranty/odoo/addons/stock_production_lot_warranty b/setup/stock_production_lot_warranty/odoo/addons/stock_production_lot_warranty new file mode 120000 index 00000000..b64b017f --- /dev/null +++ b/setup/stock_production_lot_warranty/odoo/addons/stock_production_lot_warranty @@ -0,0 +1 @@ +../../../../stock_production_lot_warranty \ No newline at end of file diff --git a/setup/stock_production_lot_warranty/setup.py b/setup/stock_production_lot_warranty/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/stock_production_lot_warranty/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_production_lot_warranty/tests/test_product_lot_warranty.py b/stock_production_lot_warranty/tests/test_product_lot_warranty.py index f386f6ca..fa665cf3 100644 --- a/stock_production_lot_warranty/tests/test_product_lot_warranty.py +++ b/stock_production_lot_warranty/tests/test_product_lot_warranty.py @@ -1,24 +1,26 @@ # Copyright (C) 2021 Open Source Integrators # Copyright (C) 2021 Serpent Consulting Services # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo.tests import common from datetime import datetime, timedelta +from odoo.tests import common + class TestProductLotWarranty(common.TransactionCase): def test_productlot_warranty(self): - company1 = self.env["res.company"].create({ - "name": "Test company1" - }) - product1 = self.env["product.product"].create({ - "name": "TestProduct", - "warranty_type": "day", - "warranty": 5, - }) - production_lot = self.env["stock.production.lot"].create({ - "product_id": product1.id, - "company_id": company1.id - }) + company1 = self.env["res.company"].create({"name": "Test company1"}) + product1 = self.env["product.product"].create( + { + "name": "TestProduct", + "warranty_type": "day", + "warranty": 5, + } + ) + production_lot = self.env["stock.production.lot"].create( + {"product_id": product1.id, "company_id": company1.id} + ) production_lot._onchange_product_id() - self.assertEqual(production_lot.warranty_exp_date, - (datetime.now() + timedelta(days=5)).date()) + self.assertEqual( + production_lot.warranty_exp_date, + (datetime.now() + timedelta(days=5)).date(), + )