2 In order to test the exclusive type requisition, I have to create two differ purchase order in one requisition [Tender]
4 I start by Checking the product, Product must have requisition field checked.
6 !record {model: product.product, id: product.product_product_cpu1}:
7 purchase_requisition: True
9 Checking requisition field for another product.
11 !record {model: product.product, id: product.product_product_cpu3}:
12 purchase_requisition: True
14 Now check that purchase order's product must have requisition field checked.
16 !python {model: purchase.order}: |
18 wf_service = netsvc.LocalService("workflow")
19 pur_order = self.pool.get('purchase.order')
20 ids = pur_order.search(cr, uid, [('requisition_id','=',ref('order_purchase_requisition1'))])
21 po_id = pur_order.browse(cr, uid, ids)
23 for line in po.order_line:
24 if line.product_id.purchase_requisition == False:
25 assert line.product_id.purchase_requisition == True, "Purchase Order's product must have requisition field checked"
26 po_confirm = po_id[0].id
27 wf_service.trg_validate(uid, 'purchase.order',po_confirm,'purchase_confirm', cr)
28 assert po_id[0].state == 'approved',"After confirm a purchase order it should be in confirm state"
29 assert po_id[1].state == 'cancel',"After confirmed a purchase order form the this requisition the second purchase order should be automatically goes in to cancelled state"