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="final_on_hand_qty"/>
|
||||
<field name="to_procure"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
@@ -36,6 +37,7 @@
|
||||
<field name="mrp_area_id"/>
|
||||
<field name="mrp_product_id"/>
|
||||
<field name="date"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
<field name="initial_on_hand_qty"/>
|
||||
<field name="demand_qty"/>
|
||||
<field name="supply_qty"/>
|
||||
@@ -45,7 +47,7 @@
|
||||
<button string="Create Procurement"
|
||||
name="%(mrp_multi_level.act_mrp_inventory_procure)d"
|
||||
icon="fa-cogs" type="action"
|
||||
attrs="{'invisible':[('to_procure','==',0.0)]}"/>
|
||||
attrs="{'invisible':[('to_procure','<=',0.0)]}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -80,6 +80,9 @@ class MrpInventoryProcure(models.TransientModel):
|
||||
'INT: ' + str(self.env.user.login), # origin?
|
||||
values
|
||||
)
|
||||
item.mrp_inventory_id.to_procure -= \
|
||||
item.uom_id._compute_quantity(
|
||||
item.qty, item.product_id.uom_id)
|
||||
except UserError as error:
|
||||
errors.append(error.name)
|
||||
if errors:
|
||||
|
||||
Reference in New Issue
Block a user