[IMP]: Improve the yml for purchase_requisition and delivery

bzr revid: sbh@tinyerp.com-20100513064832-rbv0erf9aujoj42n
This commit is contained in:
sbh (Open ERP) 2010-05-13 12:18:32 +05:30
parent bade8c919c
commit c1eb9abf86
3 changed files with 17 additions and 10 deletions

View File

@ -1,5 +1,5 @@
-
In order to test the delivery module, I will do Configuration ‣ Delivery ‣ Delivery Method
In order to test the delivery module, I will do Configuration -> Delivery -> Delivery Method
And there are two methods for doing that
Delivery based on order quantities,
Delivery based on delivered quantities.
@ -37,14 +37,14 @@
-
Creating a Delivery Method
I create the Delivery Method
-
!record {model: delivery.carrier, id: delivery_carrier_theopenerpexperss0}:
name: The OpenERP Experss
partner_id: res_partner_thepost0
product_id: product_product_deliverybypost0
-
Creating a delivery.grid record and define the region for which the tariffs in the grid will be applicable.
I Create a delivery grid record and define the region for which the tariffs in the grid will be applicable.
Then set the condition for which this rule is applicable
-
!record {model: delivery.grid, id: delivery_grid_weight0}:

View File

@ -1,6 +1,6 @@
-
In order to test the purchase requicisition module, I will do a sale order -> purchase_requisition ->
In order to test the purchase requisition module, I will do a sale order -> purchase_requisition ->
purchase flow and I will buy the required products at two different suppliers.
-
I start by creating a new product 'Laptop ACER', which is purchased at Asustek, in MTO,
@ -109,10 +109,12 @@
!python {model: purchase.order}: |
line_obj=self.pool.get('purchase.order.line')
partner_obj=self.pool.get('res.partner')
requistion_obj=self.pool.get('purchase.requisition')
requistion_ids =requistion_obj.search(cr, uid, [('origin','=','TEST/TENDER/0001')])
partner_id1=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0]
partner_id2=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0]
purchase_id1= self.search(cr, uid, [('partner_id','=',partner_id1)])
purchase_id2= self.search(cr, uid, [('partner_id','=',partner_id2)])
partner_id2=partner_obj.search(cr,uid,[('name','=','Distrib PC')])[0]
purchase_id1= self.search(cr, uid, [('partner_id','=',partner_id1),('requisition_id','in',requistion_ids)])
purchase_id2= self.search(cr, uid, [('partner_id','=',partner_id2),('requisition_id','in',requistion_ids)])
order_line1=self.browse(cr, uid, purchase_id1, context)[0].order_line[0].id
order_line2=self.browse(cr, uid, purchase_id2, context)[0].order_line[0].id
line_obj.write(cr, uid, order_line1, {'product_qty':2})
@ -147,6 +149,7 @@
!python {model: stock.picking }: |
import time
partner_obj=self.pool.get('res.partner')
order_obj=self.pool.get('purchase.order')
partner_id=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0]
picking_id = self.search(cr, uid, [('address_id.partner_id','=',partner_id),('type','=','in')])
if picking_id:

View File

@ -1,5 +1,5 @@
-
In order to test the purchase requicisition module, I will do a sale order -> purchase_requisition ->
In order to test the purchase requisition module, I will do a sale order -> purchase_requisition ->
purchase flow and I will buy the required products at two different suppliers.
-
@ -99,7 +99,9 @@
-
!python {model: purchase.order}: |
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0]
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id)])[0]
req_obj = self.pool.get('purchase.requisition')
ids =req_obj.search(cr, uid, [('origin','=','TEST/TENDER/0002')])
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
import netsvc
wf_service = netsvc.LocalService("workflow")
if purchase_id:
@ -110,6 +112,8 @@
-
!python {model: purchase.order}: |
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0]
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id)])[0]
req_obj = self.pool.get('purchase.requisition')
ids =req_obj.search(cr, uid, [('origin','=','TEST/TENDER/0002')])
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
state=self.browse(cr,uid,purchase_id).state
assert (state=='cancel')