mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_multi_level: Show supply method on mrp inventory
This commit is contained in:
@@ -62,6 +62,12 @@ class MrpInventory(models.Model):
|
|||||||
planned_order_ids = fields.One2many(
|
planned_order_ids = fields.One2many(
|
||||||
comodel_name="mrp.planned.order", inverse_name="mrp_inventory_id", readonly=True
|
comodel_name="mrp.planned.order", inverse_name="mrp_inventory_id", readonly=True
|
||||||
)
|
)
|
||||||
|
supply_method = fields.Selection(
|
||||||
|
string="Supply Method",
|
||||||
|
related="product_mrp_area_id.supply_method",
|
||||||
|
readonly=True,
|
||||||
|
store=True,
|
||||||
|
)
|
||||||
|
|
||||||
def _compute_uom_id(self):
|
def _compute_uom_id(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<field name="company_id" groups="base.group_multi_company"/>
|
<field name="company_id" groups="base.group_multi_company"/>
|
||||||
<field name="product_id"/>
|
<field name="product_id"/>
|
||||||
<field name="product_mrp_area_id"/>
|
<field name="product_mrp_area_id"/>
|
||||||
|
<field name="supply_method"/>
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
@@ -51,6 +52,7 @@
|
|||||||
name="%(mrp_multi_level.act_mrp_inventory_procure)d"
|
name="%(mrp_multi_level.act_mrp_inventory_procure)d"
|
||||||
icon="fa-cogs" type="action"
|
icon="fa-cogs" type="action"
|
||||||
attrs="{'invisible':[('to_procure','<=',0.0)]}"/>
|
attrs="{'invisible':[('to_procure','<=',0.0)]}"/>
|
||||||
|
<field name="supply_method"/>
|
||||||
<field name="running_availability"/>
|
<field name="running_availability"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -103,6 +105,9 @@
|
|||||||
<filter name="group_mrp_area"
|
<filter name="group_mrp_area"
|
||||||
string="MRP Area"
|
string="MRP Area"
|
||||||
context="{'group_by':'mrp_area_id'}"/>
|
context="{'group_by':'mrp_area_id'}"/>
|
||||||
|
<filter name="group_supply_method"
|
||||||
|
string="Supply Method"
|
||||||
|
context="{'group_by':'supply_method'}"/>
|
||||||
<filter name="group_release_date_day"
|
<filter name="group_release_date_day"
|
||||||
string="Date to Procure (By Day)"
|
string="Date to Procure (By Day)"
|
||||||
context="{'group_by':'order_release_date:day'}"/>
|
context="{'group_by':'order_release_date:day'}"/>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class MrpInventoryProcure(models.TransientModel):
|
|||||||
"warehouse_id": planned_order.mrp_area_id.warehouse_id.id,
|
"warehouse_id": planned_order.mrp_area_id.warehouse_id.id,
|
||||||
"location_id": planned_order.product_mrp_area_id.location_proc_id.id
|
"location_id": planned_order.product_mrp_area_id.location_proc_id.id
|
||||||
or planned_order.mrp_area_id.location_id.id,
|
or planned_order.mrp_area_id.location_id.id,
|
||||||
|
"supply_method": planned_order.product_mrp_area_id.supply_method,
|
||||||
}
|
}
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
@@ -116,6 +117,17 @@ class MrpInventoryProcureItem(models.TransientModel):
|
|||||||
product_id = fields.Many2one(string="Product", comodel_name="product.product")
|
product_id = fields.Many2one(string="Product", comodel_name="product.product")
|
||||||
warehouse_id = fields.Many2one(string="Warehouse", comodel_name="stock.warehouse")
|
warehouse_id = fields.Many2one(string="Warehouse", comodel_name="stock.warehouse")
|
||||||
location_id = fields.Many2one(string="Location", comodel_name="stock.location")
|
location_id = fields.Many2one(string="Location", comodel_name="stock.location")
|
||||||
|
supply_method = fields.Selection(
|
||||||
|
string="Supply Method",
|
||||||
|
selection=[
|
||||||
|
("buy", "Buy"),
|
||||||
|
("none", "Undefined"),
|
||||||
|
("manufacture", "Produce"),
|
||||||
|
("pull", "Pull From"),
|
||||||
|
("push", "Push To"),
|
||||||
|
("pull_push", "Pull & Push"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
def _prepare_procurement_values(self, group=False):
|
def _prepare_procurement_values(self, group=False):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
<field name="qty"/>
|
<field name="qty"/>
|
||||||
<field name="uom_id" groups="uom.group_uom"/>
|
<field name="uom_id" groups="uom.group_uom"/>
|
||||||
<field name="date_planned"/>
|
<field name="date_planned"/>
|
||||||
|
<field name="supply_method"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user