[15.0][MIG] mrp_multi_level

This commit is contained in:
Christopher Ormaza
2021-12-10 11:29:07 -05:00
committed by Lois Rilo
parent eb236f7888
commit ec93a5fe41
16 changed files with 59 additions and 64 deletions

View File

@@ -45,21 +45,17 @@ class MrpInventory(models.Model):
uom_id = fields.Many2one(
comodel_name="uom.uom", string="Product UoM", compute="_compute_uom_id"
)
date = fields.Date(string="Date")
date = fields.Date()
demand_qty = fields.Float(string="Demand")
supply_qty = fields.Float(string="Supply")
initial_on_hand_qty = fields.Float(string="Starting Inventory")
final_on_hand_qty = fields.Float(string="Forecasted Inventory")
to_procure = fields.Float(
string="To procure", compute="_compute_to_procure", store=True
)
to_procure = fields.Float(compute="_compute_to_procure", store=True)
running_availability = fields.Float(
string="Planned Availability",
help="Theoretical inventory level if all planned orders" "were released.",
)
order_release_date = fields.Date(
string="Order Release Date", compute="_compute_order_release_date", store=True
help="Theoretical inventory level if all planned orders were released.",
)
order_release_date = fields.Date(compute="_compute_order_release_date", store=True)
planned_order_ids = fields.One2many(
comodel_name="mrp.planned.order", inverse_name="mrp_inventory_id", readonly=True
)

View File

@@ -37,8 +37,8 @@ class MrpMove(models.Model):
store=True,
)
current_date = fields.Date(string="Current Date")
current_qty = fields.Float(string="Current Qty")
current_date = fields.Date()
current_qty = fields.Float()
mrp_date = fields.Date(string="MRP Date")
planned_order_up_ids = fields.Many2many(
comodel_name="mrp.planned.order",
@@ -87,7 +87,6 @@ class MrpMove(models.Model):
("to approve", "To Approve"),
("approved", "Approved"),
],
string="State",
)
stock_move_id = fields.Many2one(
comodel_name="stock.move", string="Stock Move", index=True

View File

@@ -42,7 +42,6 @@ class MrpPlannedOrder(models.Model):
string="Release Date", help="Order release date planned by MRP.", required=True
)
due_date = fields.Date(
string="Due Date",
help="Date in which the supply must have been completed.",
required=True,
)

View File

@@ -82,7 +82,6 @@ class ProductMRPArea(models.Model):
("push", "Push To"),
("pull_push", "Pull & Push"),
],
string="Supply Method",
compute="_compute_supply_method",
)
qty_available = fields.Float(
@@ -170,7 +169,7 @@ class ProductMRPArea(models.Model):
def _compute_qty_available(self):
for rec in self:
rec.qty_available = rec.product_id.with_context(
{"location": rec.mrp_area_id.location_id.id}
location=rec.mrp_area_id.location_id.id
).qty_available
def _compute_supply_method(self):