[IMP] mrp: Improved yaml test cases.
bzr revid: uco@tinyerp.com-20100511125213-zsipuad1jvtmn3k8
This commit is contained in:
@@ -129,7 +129,6 @@
|
||||
date_planned: '2010-04-16 15:53:36'
|
||||
location_dest_id: stock.stock_location_output
|
||||
location_src_id: stock.stock_location_stock
|
||||
name: MO/00002
|
||||
product_id: product_product_orangejuice0
|
||||
product_qty: 100.0
|
||||
product_uom: product_uom_litre0
|
||||
@@ -171,7 +170,7 @@
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('origin','=',':MO/00002')])
|
||||
proc_ids = self.search(cr, uid, [('state','!=','cofirmed')])
|
||||
assert proc_ids, _('No Procurements!')
|
||||
-
|
||||
The scheduler runs.
|
||||
@@ -196,7 +195,7 @@
|
||||
!python {model: purchase.order}: |
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
purch_ids = self.search(cr, uid, [('origin','in',['SCHEDULER','OP/00002','OP/00003'])])
|
||||
purch_ids = self.search(cr, uid, [('state','=','draft')])
|
||||
assert purch_ids, _('No Purchase Orders were made!')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for p_id in purch_ids:
|
||||
@@ -207,7 +206,7 @@
|
||||
!python {model: purchase.order}: |
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
purch_ids = self.search(cr, uid, [('origin','in',['SCHEDULER','OP/00002','OP/00003']),('state','=','confirmed')])
|
||||
purch_ids = self.search(cr, uid, [('state','=','confirmed')])
|
||||
assert purch_ids, _('No Confirmed Purchase Orders found!')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for p_id in purch_ids:
|
||||
@@ -217,7 +216,7 @@
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
from tools.translate import _
|
||||
pick_ids = self.search(cr, uid, [('origin','in',['PO00001:SCHEDULER','PO00002:SCHEDULER','PO00003:OP/00002','PO00004:OP/00003']),('type','=','in')])
|
||||
pick_ids = self.search(cr, uid, [('type','=','in')])
|
||||
assert pick_ids, _('No Incoming Shipments found!')
|
||||
-
|
||||
I receive both the products. My incoming pickings are done.
|
||||
@@ -229,6 +228,7 @@
|
||||
-
|
||||
!python {model: stock.partial.picking}: |
|
||||
pick_obj = self.pool.get('stock.picking')
|
||||
picking_ids = pick_obj.search(cr, uid, [('origin','in',['PO00001:SCHEDULER','PO00002:SCHEDULER','PO00003:OP/00002','PO00004:OP/00003']),('type','=','in')])
|
||||
self.do_partial(cr, uid, [1],context={'active_ids': picking_ids})
|
||||
picking_ids = pick_obj.search(cr, uid, [('type','=','in')])
|
||||
self.view_init(cr, uid, ['date','partner_id','address_id'],context={'active_ids': picking_ids})
|
||||
self.do_partial(cr, uid, [1], context={'active_ids': picking_ids})
|
||||
|
||||
@@ -86,27 +86,27 @@
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('origin','=',':MO/00004')])
|
||||
proc_ids = self.search(cr, uid, [('state','!=','confirmed')])
|
||||
assert proc_ids, _('No Procurements!')
|
||||
-
|
||||
The scheduler runs.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
search: "[('origin','=',':MO/00004')]"
|
||||
search: "[('state','=','cofirmed')]"
|
||||
-
|
||||
I am checking Internal picking.
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
from tools.translate import _
|
||||
pick_ids = self.search(cr, uid, [('origin','=',':MO/00004'),('type','=','internal')])
|
||||
pick_ids = self.search(cr, uid, [('state','!=','done'),('type','=','internal')])
|
||||
assert pick_ids, _('No Internal Pickings!')
|
||||
-
|
||||
I see that there is a manufacturing order for the subproduct of PC1 with ready state.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from tools.translate import _
|
||||
order_ids = self.search(cr, uid, [('origin','=',':MO/00004'),('state','=','ready')])
|
||||
order_ids = self.search(cr, uid, [('state','=','confirmed')])
|
||||
assert order_ids, _('No manufacturing order!')
|
||||
-
|
||||
I start producing that product first. So I marked it as started.
|
||||
@@ -117,7 +117,7 @@
|
||||
-
|
||||
!python {model: mrp.product.produce}: |
|
||||
prod_obj = self.pool.get('mrp.production')
|
||||
prod_ids = prod_obj.search(cr, uid, [('origin','=',':MO/00004')])
|
||||
prod_ids = prod_obj.search(cr, uid, [('state','=','confirmed')])
|
||||
self.do_produce(cr, uid, [1], context={'active_ids': prod_ids})
|
||||
-
|
||||
Now the manufacturing order for subproduct CPU_GEN is done. And manufacturing
|
||||
@@ -125,7 +125,7 @@
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
from tools.translate import _
|
||||
prod_ids = self.search(cr, uid, [('origin','=',':MO/00004'),('state','=','done')])
|
||||
prod_ids = self.search(cr, uid, [('state','!=','done')])
|
||||
assert prod_ids, _('Manufacturing order is yet not done!')
|
||||
-
|
||||
I start producing the product PC1.
|
||||
|
||||
Reference in New Issue
Block a user