[FIX]: procurement: Fixed demo and yml for procurement orders as per new changes, Improved demo of minimum stock rules
bzr revid: rpa@tinyerp.com-20120717120342-pe1d0udpkby03o16
This commit is contained in:
parent
22b70d9aa0
commit
efac1bc0ff
|
@ -5,27 +5,27 @@
|
|||
<!-- Resource: stock.warehouse.orderpoint -->
|
||||
|
||||
<record id="stock_warehouse_orderpoint_0" model="stock.warehouse.orderpoint">
|
||||
<field name="product_max_qty">20.0</field>
|
||||
<field name="product_max_qty">25.0</field>
|
||||
<field name="product_min_qty">5.0</field>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_dozen"/>
|
||||
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_7"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_36"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
</record>
|
||||
<record id="stock_warehouse_orderpoint_1" model="stock.warehouse.orderpoint">
|
||||
<field name="product_max_qty">50.0</field>
|
||||
<field name="product_min_qty">10.0</field>
|
||||
<field name="product_max_qty">10.0</field>
|
||||
<field name="product_min_qty">5.0</field>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_9"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_28"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
</record>
|
||||
<record id="stock_warehouse_orderpoint_2" model="stock.warehouse.orderpoint">
|
||||
<field name="product_max_qty">20.0</field>
|
||||
<field name="product_min_qty">10.0</field>
|
||||
<field name="product_max_qty">12.0</field>
|
||||
<field name="product_min_qty">5.0</field>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_11"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_20"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
</record>
|
||||
<record id="stock_warehouse_orderpoint_3" model="stock.warehouse.orderpoint">
|
||||
|
@ -33,23 +33,23 @@
|
|||
<field name="product_min_qty">10.0</field>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_14"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_46"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
</record>
|
||||
<record id="stock_warehouse_orderpoint_4" model="stock.warehouse.orderpoint">
|
||||
<field name="product_max_qty">15.0</field>
|
||||
<field name="product_min_qty">5.0</field>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_23"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
</record>
|
||||
<record id="stock_warehouse_orderpoint_5" model="stock.warehouse.orderpoint">
|
||||
<field name="product_max_qty">5.0</field>
|
||||
<field name="product_min_qty">3.0</field>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_3"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
</record>
|
||||
<record id="stock_warehouse_orderpoint_5" model="stock.warehouse.orderpoint">
|
||||
<field name="product_max_qty">50.0</field>
|
||||
<field name="product_min_qty">10.0</field>
|
||||
<field model="product.uom" name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field model="stock.warehouse" name="warehouse_id" search="[]"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_27"/>
|
||||
<field model="product.product" name="product_id" ref="product.product_product_48"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
</record>
|
||||
</data>
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
location_id: stock.stock_location_stock
|
||||
logic: max
|
||||
name: OP/00008
|
||||
product_id: product.product_product_19
|
||||
product_id: product.product_product_32
|
||||
product_max_qty: 15.0
|
||||
product_min_qty: 5.0
|
||||
product_uom: product.product_uom_kgm
|
||||
product_uom: product.product_uom_unit
|
||||
qty_multiple: 1
|
||||
warehouse_id: stock.warehouse0
|
||||
-
|
||||
Check product quantity and update it, if needed for apply a minimum stock rule.
|
||||
-
|
||||
!python {model: product.product}: |
|
||||
product = self.browse(cr, uid, ref('product.product_product_19'))
|
||||
product = self.browse(cr, uid, ref('product.product_product_32'))
|
||||
if product.virtual_available < 5.0:
|
||||
change_qty = self.pool.get('stock.change.product.qty')
|
||||
id = change_qty.create(cr, uid, {'location_id' : ref('stock.stock_location_stock'), 'new_quantity': 4, 'product_id': product.id})
|
||||
|
@ -34,7 +34,7 @@
|
|||
I check that procurement order is based on minimum stock rule.
|
||||
-
|
||||
!python {model: procurement.order}: |
|
||||
proc_ids = self.search(cr, uid, [('product_id','=', ref('product.product_product_19'))])
|
||||
proc_ids = self.search(cr, uid, [('product_id','=', ref('product.product_product_32'))])
|
||||
assert proc_ids, 'No Procurement created.'
|
||||
proc_order = self.browse(cr, uid, proc_ids)[0]
|
||||
assert proc_order.product_qty == 11.0,"Procurement product quantity is not corresponded."
|
||||
|
@ -42,7 +42,7 @@
|
|||
I check product quantity.
|
||||
-
|
||||
!python {model: product.product}: |
|
||||
product = self.browse(cr, uid, ref('product.product_product_19'))
|
||||
product = self.browse(cr, uid, ref('product.product_product_32'))
|
||||
assert product.virtual_available == 15.0,"After run the scheduler product's virtual stock is not updated."
|
||||
-
|
||||
For test the Procurement Request wizard, Again I have to update product quantity.
|
||||
|
@ -50,9 +50,9 @@
|
|||
!python {model: product.product}: |
|
||||
mk_procure = self.pool.get('make.procurement')
|
||||
procur_order = self.pool.get('procurement.order')
|
||||
product = self.browse(cr, uid, ref('product.product_product_19'))
|
||||
product = self.browse(cr, uid, ref('product.product_product_32'))
|
||||
|
||||
context.update({'active_model': 'product.product','active_id':ref('product.product_product_19')})
|
||||
context.update({'active_model': 'product.product','active_id':ref('product.product_product_32')})
|
||||
values = {'warehouse_id': ref('base.main_company'), 'uom_id': ref('product.product_uom_unit'), 'qty': 5}
|
||||
id = mk_procure.create(cr, uid, values, context)
|
||||
procurement = mk_procure.make_procurement(cr, uid, [id], context)
|
||||
|
@ -62,7 +62,7 @@
|
|||
for procurement in procur_order.browse(cr, uid, [proc_id]):
|
||||
if procurement.state == 'confirmed':
|
||||
assert procurement.state == 'confirmed',"Procurement state should be 'Confirmed'."
|
||||
assert procurement.product_id.id == ref('product.product_product_19'),"Product is not correspond."
|
||||
assert procurement.product_id.id == ref('product.product_product_32'),"Product is not correspond."
|
||||
assert procurement.product_qty == 5,"Product Quantity is not correspond."
|
||||
assert procurement.product_uom.id == ref('product.product_uom_unit'),"Product's UOM is not correspond."
|
||||
context.update({'proc': proc_id})
|
||||
|
|
Loading…
Reference in New Issue