[IMP] improved mrp_subproduct.yml
bzr revid: bde@tinyerp.com-20120720120029-o4y53q3b09fhldyo
This commit is contained in:
parent
e3bb82b458
commit
0354b79204
|
@ -2,11 +2,11 @@
|
|||
In order to test mrp_subproduct with OpenERP, I add subproduct in bill of material.
|
||||
I make a production order, confirm it so stock moves for subproducts are generated.
|
||||
-
|
||||
I add a sub product in Bill of material for product Cabinet.
|
||||
I add a sub product in Bill of material for product External Hard Disk.
|
||||
-
|
||||
!record {model: mrp.bom, id: mrp_bom_arm1}:
|
||||
product_id: product.product_product_28
|
||||
name: ARM100 + Subproduct
|
||||
name: External Hard Disk + Subproduct
|
||||
product_uom: product.product_uom_unit
|
||||
sub_products:
|
||||
- product_id: product.product_product_33
|
||||
|
@ -14,7 +14,7 @@
|
|||
product_qty: 2.0
|
||||
subproduct_type: fixed
|
||||
-
|
||||
I create a production order for Cabinet.
|
||||
I create a production order for External Hard Disk.
|
||||
-
|
||||
!record {model: mrp.production, id: mrp_production_mo0}:
|
||||
product_id: product.product_product_28
|
||||
|
@ -67,9 +67,10 @@
|
|||
!python {model: mrp.product.produce}: |
|
||||
self.do_produce(cr, uid, [ref("mrp_product_produce0")], {"active_model": "mrp.production", "active_ids":[ref("mrp_production_mo0")], "active_id": ref("mrp_production_mo0")})
|
||||
-
|
||||
I see that stock moves of Cabinet including Wooden Table are done now.
|
||||
I see that stock moves of External Hard Disk including Headset USB are done now.
|
||||
-
|
||||
!python {model: stock.move}: |
|
||||
move_ids = self.search(cr, uid, [('product_id','in',[ref("product.product_product_28"),ref("product.product_product_41")])])
|
||||
production_order = self.pool.get('mrp.production').browse(cr, uid, ref("mrp_production_mo0"))
|
||||
move_ids = self.search(cr, uid, [('origin','=',production_order.name), ('product_id','in',[ref("product.product_product_28"),ref("product.product_product_33")])])
|
||||
moves = self.browse(cr, uid, move_ids)
|
||||
assert all(move.state == 'done' for move in moves), 'Moves are not done!'
|
||||
|
|
Loading…
Reference in New Issue