mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[IMP] stock_production_lot_warranty: black, isort, prettier
This commit is contained in:
@@ -0,0 +1 @@
|
||||
../../../../stock_production_lot_warranty
|
||||
6
setup/stock_production_lot_warranty/setup.py
Normal file
6
setup/stock_production_lot_warranty/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
@@ -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(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user