[ADD,IMP]procurement:
Add new yml file for define the process of make procurement wizard. Improve the __openerp__.py for this addition. bzr revid: dbr@tinyerp.com-20111212070908-qd4889oiputnemuj
This commit is contained in:
@@ -59,7 +59,9 @@ depending on the product's configuration.
|
||||
'board_mrp_procurement_view.xml',
|
||||
],
|
||||
'demo_xml': ['stock_orderpoint.xml'],
|
||||
'test': ['test/procurement.yml'],
|
||||
'test': ['test/procurement.yml',
|
||||
'test/procurement_request.yml'
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '00954248826881074509',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
location_id: stock.stock_location_stock
|
||||
logic: max
|
||||
name: OP/00008
|
||||
product_id: product.product_product_cpu2
|
||||
product_id: product.product_product_cpu2
|
||||
product_max_qty: 15.0
|
||||
product_min_qty: 5.0
|
||||
product_uom: product.product_uom_kgm
|
||||
@@ -37,4 +37,3 @@
|
||||
!python {model: product.product}: |
|
||||
product = self.browse(cr, uid, ref('product.product_product_cpu2'))
|
||||
assert product.virtual_available >= 5.0,"After run the scheduler product's virtual stock is not updated."
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
-
|
||||
For test the Procurement Request wizard, First I have to update product quantity.
|
||||
-
|
||||
!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_hdd3'))
|
||||
|
||||
context.update({'active_model': 'product.product','active_id':ref('product.product_product_hdd3')})
|
||||
values = mk_procure.default_get(cr, uid, ['qty','product_id','uom_id','warehouse_id','date_planned'], context)
|
||||
values.update({'warehouse_id': ref('base.main_company'),'uom_id': ref('product.product_uom_unit'),'qty': 5})
|
||||
|
||||
ids = mk_procure.create(cr, uid, values, context)
|
||||
procurement = mk_procure.make_procurement(cr, uid, [ids], context)
|
||||
assert product.virtual_available >= 5.0,'Virtual stock should be updated'
|
||||
|
||||
proc_id = procurement.get('res_id')
|
||||
procurements = procur_order.browse(cr, uid, [proc_id])[0]
|
||||
assert procurements.product_id.id == ref('product.product_product_hdd3'),"product is not correspond."
|
||||
assert procurements.product_qty >= 5,"product Quantity is not correspond."
|
||||
assert procurements.state == 'confirmed',"Procurement sytate should be in 'Confirmed'."
|
||||
assert procurements.product_uom.id == ref('product.product_uom_unit'),"product's UOM is not correspond."
|
||||
Reference in New Issue
Block a user