mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[11.0][IMP] mrp_multi_level: reduce qty to procure with each procure done.
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
<field name="supply_qty"/>
|
<field name="supply_qty"/>
|
||||||
<field name="final_on_hand_qty"/>
|
<field name="final_on_hand_qty"/>
|
||||||
<field name="to_procure"/>
|
<field name="to_procure"/>
|
||||||
|
<field name="uom_id" groups="product.group_uom"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</sheet>
|
</sheet>
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
<field name="mrp_area_id"/>
|
<field name="mrp_area_id"/>
|
||||||
<field name="mrp_product_id"/>
|
<field name="mrp_product_id"/>
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
|
<field name="uom_id" groups="product.group_uom"/>
|
||||||
<field name="initial_on_hand_qty"/>
|
<field name="initial_on_hand_qty"/>
|
||||||
<field name="demand_qty"/>
|
<field name="demand_qty"/>
|
||||||
<field name="supply_qty"/>
|
<field name="supply_qty"/>
|
||||||
@@ -45,7 +47,7 @@
|
|||||||
<button string="Create Procurement"
|
<button string="Create Procurement"
|
||||||
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)]}"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ class MrpInventoryProcure(models.TransientModel):
|
|||||||
'INT: ' + str(self.env.user.login), # origin?
|
'INT: ' + str(self.env.user.login), # origin?
|
||||||
values
|
values
|
||||||
)
|
)
|
||||||
|
item.mrp_inventory_id.to_procure -= \
|
||||||
|
item.uom_id._compute_quantity(
|
||||||
|
item.qty, item.product_id.uom_id)
|
||||||
except UserError as error:
|
except UserError as error:
|
||||||
errors.append(error.name)
|
errors.append(error.name)
|
||||||
if errors:
|
if errors:
|
||||||
|
|||||||
Reference in New Issue
Block a user