2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-11-17 11:27:10 +00:00
|
|
|
In order to test the process of supplier invoice, I enter the amount for a total of invoice
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
|
|
|
!python {model: account.invoice}: |
|
|
|
|
self.write(cr, uid, [ref('account.demo_invoice_0')], {'check_total': 14})
|
|
|
|
-
|
2011-11-17 11:27:10 +00:00
|
|
|
In order to test account move line of journal, I check that there is no move attached to the invoice at draft
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
|
|
|
!python {model: account.invoice}: |
|
|
|
|
invoice = self.browse(cr, uid, ref("account.demo_invoice_0"))
|
|
|
|
assert (not invoice.move_id), "Move wrongly created at draft"
|
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
I change the state of invoice to "open".
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
|
|
|
!workflow {model: account.invoice, action: invoice_open, ref: account.demo_invoice_0}
|
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
I check that the invoice state is now "Open".
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
!assert {model: account.invoice, id: account.demo_invoice_0, severity: error, string: Invoice should be in 'Open' state}:
|
2011-11-15 06:35:30 +00:00
|
|
|
- state == 'open'
|
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
I change the state of Payment Order to "Confirmed".
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
!workflow {model: payment.order, action: open, ref: payment_order_1}
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
I check that Payment order is now "Confirmed".
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
!assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Confirmed' state}:
|
2011-11-15 06:35:30 +00:00
|
|
|
- state == 'open'
|
2011-12-20 12:09:24 +00:00
|
|
|
-
|
|
|
|
I create a record for payment order create.
|
|
|
|
-
|
|
|
|
!record {model: payment.order.create, id: payment_order_create_0}:
|
|
|
|
duedate: !eval time.strftime('%Y-%m-%d')
|
|
|
|
-
|
|
|
|
I perform a action to search the entries for create a payment line
|
|
|
|
-
|
|
|
|
!python {model: payment.order.create}: |
|
|
|
|
self.search_entries(cr, uid, [ref("payment_order_create_0")], {
|
|
|
|
"active_model": "payment.order", "active_ids": [ref("payment_order_1")],
|
|
|
|
"active_id": ref("payment_order_1"), })
|
|
|
|
-
|
|
|
|
In order to make entries in payment line, I create a entries.
|
|
|
|
-
|
|
|
|
!python {model: payment.order.create}: |
|
|
|
|
invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account.demo_invoice_0"))
|
|
|
|
move_line = invoice.move_id.line_id[0]
|
|
|
|
self.write(cr, uid, [ref("payment_order_create_0")], {'entries': [(6,0,[move_line.id])]})
|
|
|
|
self.create_payment(cr, uid, [ref("payment_order_create_0")], {
|
|
|
|
"active_model": "payment.order", "active_ids": [ref("payment_order_1")],
|
|
|
|
"active_id": ref("payment_order_1")})
|
|
|
|
-
|
|
|
|
I check a payment line is created with proper data.
|
|
|
|
-
|
|
|
|
!python {model: payment.order}: |
|
|
|
|
invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account.demo_invoice_0"))
|
|
|
|
payment = self.browse(cr, uid, ref("payment_order_1"))
|
|
|
|
payment_line = payment.line_ids[0]
|
|
|
|
|
|
|
|
assert payment_line.move_line_id, "move line is not created in payment line."
|
|
|
|
assert invoice.move_id.name == payment_line.ml_inv_ref.number, "invoice reference number is not same created."
|
|
|
|
assert invoice.partner_id == payment_line.partner_id, "partner is not same created."
|
|
|
|
assert invoice.date_due == payment_line.ml_maturity_date, "due date is not same created."
|
|
|
|
assert invoice.amount_total == payment_line.amount, "payment amount is not same created."
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
I change the state of payment order to "done".
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
|
|
|
!python {model: payment.order}: |
|
2011-12-19 06:52:14 +00:00
|
|
|
self.set_done(cr, uid, [ref("payment_order_1")])
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
I check that Payment order is now "done".
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
!assert {model: payment.order, id: payment_order_1, severity: error, string: Payment Order should be in 'Done' state}:
|
2011-11-15 06:35:30 +00:00
|
|
|
- state == 'done'
|
|
|
|
-
|
2011-12-19 06:52:14 +00:00
|
|
|
I check a payment order is done with proper data.
|
2011-11-15 06:35:30 +00:00
|
|
|
-
|
|
|
|
!python {model: payment.order}: |
|
2011-12-19 06:52:14 +00:00
|
|
|
payment = self.browse(cr, uid, ref("payment_order_1"))
|
2011-12-20 12:09:24 +00:00
|
|
|
assert payment.date_done, "date is not created after done payment order"
|
|
|
|
-
|
|
|
|
I create a record for bank statement.
|
|
|
|
-
|
|
|
|
!record {model: account.bank.statement, id: account_bank_statement_1}:
|
|
|
|
balance_end_real: 0.0
|
|
|
|
balance_start: 0.0
|
|
|
|
date: !eval time.strftime('%Y-%m-%d')
|
|
|
|
journal_id: account.bank_journal
|
|
|
|
name: /
|
|
|
|
period_id: account.period_10
|
|
|
|
-
|
|
|
|
In order to make entries in bank statement line, I import payment order lines.
|
|
|
|
-
|
|
|
|
!python {model: account.payment.populate.statement}: |
|
|
|
|
payment = self.pool.get('payment.order').browse(cr, uid, ref("payment_order_1"))
|
|
|
|
payment_line = payment.line_ids[0]
|
|
|
|
import_payment_id = self.create(cr, uid, {'lines': [(6,0,[payment_line.id])]})
|
|
|
|
self.populate_statement(cr, uid, [import_payment_id], {"statement_id": ref("account_bank_statement_1"),
|
|
|
|
"active_model": "account.bank.statement", "journal_type": "cash",
|
|
|
|
"active_id": ref("account_bank_statement_1")})
|