proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
- On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on
+ On the purchase requisition, I create a new purchase order for the supplier 'DistriPC' by clicking on
the button 'New RfQ'. This opens a window to ask me the supplier and I set DistriPC .
-
!record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}:
-
!python {model: purchase.requisition.partner}: |
req_obj = self.pool.get('purchase.requisition')
- ids =req_obj.search(cr, uid, [('origin','=','TEST/TENDER/0001')])
+ ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER')])
self.create_order(cr, uid, [ref("purchase_requisition_partner_0")], {"lang":
'en_US', "active_model": "purchase.requisition", "tz": False, "record_id":
1, "active_ids": ids, "active_id": ids[0], })
-
- I check that I have two purchase orders on the purchase tender.
+ I check that I have two purchase orders on the purchase requisition.
-
!python {model: purchase.order}: |
+ from tools.translate import _
order_ids =self.search(cr, uid, [('origin','=','TEST/TENDER/0001')])
ids=len(order_ids)
- assert (ids==2), "Purchase order hasn't Created"
+ assert(ids == 2), _('Purchase Order not Created')
+
-
I set the purchase requisition as 'Not Exclusive'.
-
!python {model: purchase.requisition}: |
- ids =self.search(cr, uid, [('origin','=','TEST/TENDER/0001')])
+ ids =self.search(cr, uid, [('origin','=','Laptop ACER')])
self.write(cr,uid,ids[0],{'exclusive': 'multiple' })
-
I change the quantities so that the purchase order for DistriPC includes 3 pieces and the
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')])
+ requistion_ids =requistion_obj.search(cr, uid, [('origin','=','Laptop ACER')])
partner_id1=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0]
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)])
I check that the delivery order of the customer is in state 'Waiting Goods'.
-
!python {model: stock.picking }: |
+ from tools.translate import _
picking_id = self.search(cr, uid, [('origin','=','TEST/TENDER/0001'),('type','=','delivery')])
if picking_id:
pick=self.browse(cr,uid,picking_id[0])
- assert (pick.state) =='confirmed'," Order is not confirm"
- assert(pick.move_lines[0].state=='wating'),'Order is not wating"'
+ assert (pick.state =='confirmed'),_('Picking is not in confirm state.')
+ assert (pick.move_lines[0].state == 'waiting'), _('Stock Move is not Waiting state.')
+
-
I receive the order of the supplier Asustek from the Incoming Products menu.
-
I check that the delivery order of the customer is in the state Available.
-
!python {model: stock.picking }: |
+ from tools.translate import _
picking_id = self.search(cr, uid, [('origin','=','TEST/TENDER/0001'),('type','=','out')])
if picking_id:
pick=self.browse(cr,uid,picking_id[0])
- assert (pick.state) =='available'," Order is not available"
+ print pick.state
+ assert(pick.state == 'assigned'), _('Picking is not in available state')
5 Laptop ACER, and a purchase order on the default supplier for this product.
-
!python {model: purchase.requisition}: |
- requisition_ids =self.search(cr, uid, [('origin','=','TEST/TENDER/0002')])
+ requisition_ids =self.search(cr, uid, [('origin','=','Laptop ACER1')])
ids=len(requisition_ids)
assert len(requisition_ids), "Purchase requisition hasn't Created"
-
- On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on
+ On the purchase requisition, I create a new purchase order for the supplier 'DistriPC' by clicking on
the button 'New Request for Quotation'. This opens a window to ask me the supplier and I set DistriPC .
-
I Create purchase.requisition.partner .
-
!python {model: purchase.requisition.partner}: |
req_obj = self.pool.get('purchase.requisition')
- ids =req_obj.search(cr, uid, [('origin','=','TEST/TENDER/0002')])
+ ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
self.create_order(cr, uid, [ref("purchase_requisition_partner_0")], {"lang":
'en_US', "active_model": "purchase.requisition", "tz": False, "record_id":
1, "active_ids": ids, "active_id": ids[0], })
-
- I set the purchase tender as 'Exclusive'
+ I set the purchase requisition as 'Exclusive'
-
!python {model: purchase.requisition}: |
- ids =self.search(cr, uid, [('origin','=','TEST/TENDER/0002')])
+ ids =self.search(cr, uid, [('origin','=','Laptop ACER1')])
self.write(cr,uid,ids[0],{'exclusive': 'exclusive' })
-
I confirm and validate the Request for Quotation of ASUStek.
!python {model: purchase.order}: |
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0]
req_obj = self.pool.get('purchase.requisition')
- ids =req_obj.search(cr, uid, [('origin','=','TEST/TENDER/0002')])
+ ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
import netsvc
wf_service = netsvc.LocalService("workflow")
!python {model: purchase.order}: |
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0]
req_obj = self.pool.get('purchase.requisition')
- ids =req_obj.search(cr, uid, [('origin','=','TEST/TENDER/0002')])
+ ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
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')
\ No newline at end of file