odoo/addons/purchase/test/process/generate_invoice_from_recep...

25 lines
902 B
YAML

-
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: stock.picking}: |
pick_ids = self.search(cr, uid, [('purchase_id','=',ref('purchase_order_2'))])
self.action_invoice_create(cr, uid, pick_ids, ref('account.expenses_journal'))
-
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."