[FIX]: Fix some assert problem in yaml as per new sale order.

bzr revid: atp@tinyerp.com-20120920042433-3rgs13orq10x2h9p
This commit is contained in:
Atul Patel (OpenERP) 2012-09-20 09:54:33 +05:30
parent 9df0234185
commit af4e61bb53
4 changed files with 42 additions and 32 deletions

View File

@ -36,16 +36,7 @@
first_invoice_id = invoice_ids[0]
wf_service.trg_validate(uid, 'account.invoice', first_invoice_id.id, 'invoice_cancel', cr)
-
I check order status in "Invoice Exception" and related invoice is in cancel state.
I check order status in "Sale to Invoice" and related invoice is in cancel state.
-
!assert {model: sale.order, id: sale_order_8, string: Sale order should be in Invoice Exception state}:
- state == "invoice_except", "Order should be in Invoice Exception state after cancel Invoice"
-
Then I click on the Ignore Exception button.
-
!workflow {model: sale.order, action: invoice_corrected, ref: sale_order_8}
-
I check state of order is 'Done'.
-
!assert {model: sale.order, id: sale_order_8, string: Sale order should be in Done state}:
- state == 'done'
- state == "manual", "Order should be in progress state after cancel Invoice"

View File

@ -3,12 +3,12 @@
-
!python {model: sale.order}: |
try:
self.unlink(cr, uid, [ref("sale_order_1")])
self.unlink(cr, uid, [ref("sale_order_7")])
except Exception,e:
pass
-
I make duplicate order and delete.
-
!python {model: sale.order}: |
id = self.copy(cr, uid, ref('sale_order_1'))
id = self.copy(cr, uid, ref('sale_order_7'))
self.unlink(cr, uid, [id])

View File

@ -67,14 +67,3 @@
assert sale_order.invoice_ids, "Invoice should be created."
assert sale_order.invoice_exists, "Order is not invoiced."
assert sale_order.invoiced, "Order is not paid."
assert sale_order.state == 'progress', 'Order should be in Progress.'
-
I set order policy "Deliver & invoice on demand" as default policy.
-
!record {model: sale.config.settings, id: sale_configuration_0}:
default_order_policy: 'manual'
-
!python {model: sale.config.settings}: |
self.execute(cr, uid, [ref("sale_configuration_0")], context=context)

View File

@ -2,41 +2,71 @@
In order to test the cancel sale order.
First I confirm order.
-
!workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_2}
!workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_8}
-
I send delivery in two shipments, so I am doing a partial delivery order.
-
!python {model: stock.picking}: |
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
first_picking = self.browse(cr, uid, delivery_orders[0], context=context)
if first_picking.force_assign(cr, uid, first_picking):
first_move = first_picking.move_lines[0]
values = {'move%s'%(first_move.id): {'product_qty': 2, 'product_uom':ref('product.product_uom_unit')}}
first_picking.do_partial(values, context=context)
-
Now I cancel latest shipment.
-
!python {model: stock.picking}: |
import netsvc
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
last_delivery_order_id = delivery_orders[0]
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', last_delivery_order_id, 'button_cancel', cr)
-
I run the scheduler.
-
!python {model: procurement.order}: |
self.run_scheduler(cr, uid)
-
I check order status in "Ship Exception".
-
!assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be in shipping exception}:
- state == "shipping_except"
-
Now I regenerate shipment.
-
!workflow {model: sale.order, action: ship_recreate, ref: sale.sale_order_2}
!workflow {model: sale.order, action: ship_recreate, ref: sale.sale_order_8}
-
I check state of order in 'To Invoice'.
-
!assert {model: sale.order, id: sale.sale_order_2, string: Sale order should be In Progress state}:
!assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be In Progress state}:
- state == 'manual'
-
I make invoice for order.
-
!workflow {model: sale.order, action: manual_invoice, ref: sale.sale_order_2}
!workflow {model: sale.order, action: manual_invoice, ref: sale.sale_order_8}
-
To cancel the sale order from Invoice Exception, I have to cancel the invoice of sale order.
-
!python {model: sale.order}: |
import netsvc
invoice_ids = self.browse(cr, uid, ref("sale.sale_order_2")).invoice_ids
invoice_ids = self.browse(cr, uid, ref("sale.sale_order_8")).invoice_ids
wf_service = netsvc.LocalService("workflow")
first_invoice_id = invoice_ids[0]
wf_service.trg_validate(uid, 'account.invoice', first_invoice_id.id, 'invoice_cancel', cr)
-
I check order status in "Invoice Exception" and related invoice is in cancel state.
-
!assert {model: sale.order, id: sale.sale_order_2, string: Sale order should be in Invoice Exception state}:
!assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be in Invoice Exception state}:
- state == "invoice_except", "Order should be in Invoice Exception state after cancel Invoice"
-
Then I click on the Ignore Exception button.
-
!workflow {model: sale.order, action: invoice_corrected, ref: sale.sale_order_2}
!workflow {model: sale.order, action: invoice_corrected, ref: sale.sale_order_8}
-
I check state of order in 'In Progress'.
-
!assert {model: sale.order, id: sale.sale_order_2, string: Sale order should be In progress state}:
!assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be In progress state}:
- state == 'progress'