2011-10-20 07:22:25 +00:00
|
|
|
-
|
|
|
|
In order to test the scheduler to generate RFQ.
|
|
|
|
-
|
2011-11-13 19:28:05 +00:00
|
|
|
I create a procurement order.
|
2011-10-20 07:22:25 +00:00
|
|
|
-
|
2011-11-14 21:33:19 +00:00
|
|
|
!record {model: procurement.order, id: procurement_order_testcase0}:
|
2011-10-20 07:22:25 +00:00
|
|
|
location_id: stock.stock_location_stock
|
|
|
|
name: Test scheduler for RFQ
|
|
|
|
procure_method: make_to_order
|
2012-06-29 11:04:24 +00:00
|
|
|
product_id: product.product_product_45
|
2011-10-20 07:22:25 +00:00
|
|
|
product_qty: 15.0
|
|
|
|
-
|
|
|
|
I confirm on procurement order.
|
|
|
|
-
|
|
|
|
!workflow {model: procurement.order, action: button_confirm, ref: procurement_order_testcase0}
|
|
|
|
-
|
|
|
|
I run the scheduler.
|
|
|
|
-
|
|
|
|
!python {model: procurement.order}: |
|
|
|
|
self.run_scheduler(cr, uid)
|
|
|
|
-
|
|
|
|
I check Generated RFQ.
|
|
|
|
-
|
|
|
|
!python {model: procurement.order}: |
|
|
|
|
procurement = self.browse(cr, uid, ref('procurement_order_testcase0'))
|
|
|
|
assert procurement.purchase_id, 'RFQ should be generated!'
|
2014-01-20 17:07:29 +00:00
|
|
|
-
|
|
|
|
I delete the line from the purchase order and check that the move and the procurement are cancelled
|
|
|
|
-
|
|
|
|
!python {model: procurement.order}: |
|
|
|
|
procurement = self.browse(cr, uid, ref('procurement_order_testcase0'))
|
|
|
|
move = procurement.purchase_id.order_line[0].move_dest_id
|
|
|
|
procurement.purchase_id.order_line[0].unlink()
|
|
|
|
assert move.state == 'cancel', 'Move should be cancelled'
|
|
|
|
procurement.refresh()
|
|
|
|
assert procurement.state == 'cancel', 'Procurement should be cancelled'
|