[MIG] mrp_multi_level_estimate: Migration to 17.0

This commit is contained in:
JasminSForgeFlow
2024-05-21 11:33:10 +05:30
parent 953f566863
commit d594152a41
3 changed files with 6 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
{ {
"name": "MRP Multi Level Estimate", "name": "MRP Multi Level Estimate",
"version": "16.0.1.1.2", "version": "17.0.1.0.0",
"development_status": "Production/Stable", "development_status": "Production/Stable",
"license": "LGPL-3", "license": "LGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)", "author": "ForgeFlow, Odoo Community Association (OCA)",

View File

@@ -54,7 +54,7 @@ class TestMrpMultiLevelEstimate(TestMrpMultiLevelCommon):
cls.date_without_ranges = today + timedelta(days=150) cls.date_without_ranges = today + timedelta(days=150)
qty = 140.0 qty = 140.0
for sd, ed in zip(start_dates, end_dates): for sd, ed in zip(start_dates, end_dates, strict=True):
qty += 70.0 qty += 70.0
cls._create_demand_estimate(cls.prod_test, cls.stock_location, sd, ed, qty) cls._create_demand_estimate(cls.prod_test, cls.stock_location, sd, ed, qty)
cls._create_demand_estimate(cls.prod_test, cls.estimate_loc, sd, ed, qty) cls._create_demand_estimate(cls.prod_test, cls.estimate_loc, sd, ed, qty)
@@ -225,7 +225,8 @@ class TestMrpMultiLevelEstimate(TestMrpMultiLevelCommon):
] ]
) )
self.assertEqual(len(estimates), 3) self.assertEqual(len(estimates), 3)
# Change qty of estimates to quantities that divided by 7 days return a decimal result # Change qty of estimates to quantities that
# divided by 7 days return a decimal result
qty = 400 qty = 400
for estimate in estimates: for estimate in estimates:
estimate.product_uom_qty = qty estimate.product_uom_qty = qty
@@ -362,7 +363,7 @@ class TestMrpMultiLevelEstimate(TestMrpMultiLevelCommon):
mo_form.product_id = fp_1 mo_form.product_id = fp_1
mo_form.bom_id = fp_1_bom mo_form.bom_id = fp_1_bom
mo_form.product_qty = 10 mo_form.product_qty = 10
mo_form.date_planned_start = date_mo mo_form.date_start = date_mo
mo = mo_form.save() mo = mo_form.save()
mo.location_src_id = ( mo.location_src_id = (
self.estimate_loc self.estimate_loc

View File

@@ -68,7 +68,7 @@ class MultiLevelMrp(models.TransientModel):
@api.model @api.model
def _init_mrp_move_from_forecast(self, product_mrp_area): def _init_mrp_move_from_forecast(self, product_mrp_area):
res = super(MultiLevelMrp, self)._init_mrp_move_from_forecast(product_mrp_area) res = super()._init_mrp_move_from_forecast(product_mrp_area)
if not product_mrp_area.group_estimate_days: if not product_mrp_area.group_estimate_days:
return False return False
today = fields.Date.today() today = fields.Date.today()