In order to test the flow of procurement orders. I will put some orders with
different procurement methods. I have installed sale, mrp and purchase modules.
-
- I am creating products.
--
+ I am creating products.
+-
I create record for product Shirt.
--
+-
!record {model: product.product, id: product_product_shirt0}:
categ_id: product.cat1
cost_method: standard
warranty: 0.0
weight: 0.0
weight_net: 0.0
--
+-
I create record for product Cloth.
--
+-
!record {model: product.product, id: product_product_cloth0}:
categ_id: product.cat1
cost_method: standard
warranty: 0.0
weight: 0.0
weight_net: 0.0
--
+-
I create record for product Buttons.
--
+-
!record {model: product.product, id: product_product_buttons0}:
categ_id: product.cat1
cost_method: standard
weight: 0.0
weight_net: 0.0
-
- I am creating bills of material for 'Shirt'.
--
+ I am creating bills of material for 'Shirt'.
+-
I create bills of material for Shirt.
--
+-
!record {model: mrp.bom, id: mrp_bom_shirt0}:
bom_lines:
- company_id: base.main_company
product_efficiency: 1.0
product_id: product_product_buttons0
product_qty: 8.0
- product_uom: product.product_uom_unit
+ product_uom: product.product_uom_kgm
product_uos_qty: 0.0
sequence: 0.0
type: normal
product_id: mrp.product_product_buttons0
product_max_qty: 50.0
product_min_qty: 10.0
- product_uom: product.product_uom_unit
+ product_uom: product.product_uom_kgm
qty_multiple: 1
warehouse_id: stock.warehouse0
-
-
I run the procurement.
-
- !workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0}
+ !workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0}
-
I see that there is a manufacturing order for Shirt.
-
picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')])
partial = self.browse(cr, uid, 1, context)
partial_datas = {
- 'delivery_date' : partial.date
+ 'delivery_date' : partial.date
}
for pick in pick_obj.browse(cr, uid, picking_ids):
for m in pick.move_lines:
'product_qty' : m.product_qty,
'product_uom' : m.product_uom.id
}
- if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
- partial_datas['move%s'%(m.id)].update({
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ partial_datas['move%s'%(m.id)].update({
'product_price' : m.product_price,
'product_currency': m.product_currency
})
picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')])
partial = self.browse(cr, uid, 1, context)
partial_datas = {
- 'delivery_date': partial.date
+ 'delivery_date': partial.date
}
for pick in pick_obj.browse(cr, uid, picking_ids):
for m in pick.move_lines:
'product_qty': m.product_qty,
'product_uom': m.product_uom.id
}
- if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
- partial_datas['move%s'%(m.id)].update({
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ partial_datas['move%s'%(m.id)].update({
'product_price': m.product_price,
'product_currency': m.product_currency
})
prod_obj = self.pool.get('mrp.production')
prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')])
self.do_produce(cr, uid, [1], context={'active_ids': prod_ids})
-
+