Files
odoo_source/addons/purchase/test/process/cancel_order.yml
T
Nicolas Martinelli cb01be235e [IMP] purchase: adaptation due to the new Purchase module
Major changes:
- No generation of invoice from PO
- Remove workflow

Reason: complete rewrite of the Purchase module.

Responsible: fp, nim
2015-09-02 08:19:56 +02:00

34 lines
1.0 KiB
YAML

-
Purchase user can also cancel order therfore test with that user which have Purchase user rights.
-
!context
uid: 'res_users_purchase_user'
-
In order to test the cancel flow, I start it from canceling confirmed purchase order.
-
I confirm the purchase order.
-
!python {model: purchase.order}: |
self.button_confirm(cr, uid, [ref("purchase_order_5")])
-
I check the "Approved" status after confirmed RFQ.
-
!assert {model: purchase.order, id: purchase_order_5}:
- state == 'purchase'
-
First I cancel receptions related to this order if order shipped.
-
!python {model: purchase.order}: |
order = self.browse(cr, uid, ref("purchase_order_5"))
self.pool.get('stock.picking').action_cancel(cr, uid, [picking.id for picking in order.picking_ids])
-
Now I am able to cancel purchase order.
-
!python {model: purchase.order}: |
self.button_cancel(cr, uid, [ref("purchase_order_5")])
-
I check that order is cancelled.
-
!assert {model: purchase.order, id: purchase_order_5}:
- state == 'cancel'