odoo/addons/account_payment/test/draft2done_payment_order.yml

45 lines
1.7 KiB
YAML

-
In order to test the process of supplier invoice, I enter the amount for a total of invoice
-
!python {model: account.invoice}: |
self.write(cr, uid, [ref('account.demo_invoice_0')], {'check_total': 14})
-
In order to test account move line of journal, I check that there is no move attached to the invoice at draft
-
!python {model: account.invoice}: |
invoice = self.browse(cr, uid, ref("account.demo_invoice_0"))
assert (not invoice.move_id), "Move wrongly created at draft"
-
I change the state of invoice to "open".
-
!workflow {model: account.invoice, action: invoice_open, ref: account.demo_invoice_0}
-
I check that the invoice state is now "Open".
-
!assert {model: account.invoice, id: account.demo_invoice_0, severity: error, string: Invoice should be in 'Open' state}:
- state == 'open'
-
I change the state of Payment Order to "Confirmed".
-
!workflow {model: payment.order, action: open, ref: payment_order_1}
-
I check that Payment order is now "Confirmed".
-
!assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Confirmed' state}:
- state == 'open'
-
I change the state of payment order to "done".
-
!python {model: payment.order}: |
self.set_done(cr, uid, [ref("payment_order_1")])
-
I check that Payment order is now "done".
-
!assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Done' state}:
- state == 'done'
-
I check a payment order is done with proper data.
-
!python {model: payment.order}: |
payment = self.browse(cr, uid, ref("payment_order_1"))
assert payment.date_done, "date is not created after done payment order"