30 lines
1.0 KiB
YAML
30 lines
1.0 KiB
YAML
-
|
|
Purchase user can create an invoice for order on receptions therfore test with that user which have Purchase user rights.
|
|
-
|
|
!context
|
|
uid: 'res_users_purchase_user'
|
|
-
|
|
I confirm another order where invoice control is 'Bases on incoming shipments'.
|
|
-
|
|
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_2}
|
|
-
|
|
I check that the invoice of order.
|
|
-
|
|
!python {model: purchase.order}: |
|
|
purchase_order = self.browse(cr, uid, ref("purchase_order_2"))
|
|
assert len(purchase_order.invoice_ids) == 0, "Invoice should not be generated on order confirmation."
|
|
-
|
|
Now I create an invoice for order on reception.
|
|
-
|
|
!python {model: purchase.order}: |
|
|
pick_ids = [self.browse(cr, uid, ref("purchase_order_2")).id]
|
|
self.action_invoice_create(cr, uid, pick_ids)
|
|
-
|
|
I check that the invoice of order.
|
|
-
|
|
!python {model: purchase.order}: |
|
|
purchase_order = self.browse(cr, uid, ref("purchase_order_2"))
|
|
assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."
|
|
|
|
|