2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
In order to test account invoice I create a new customer invoice
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!record {model: account.invoice, id: account_invoice_customer0}:
|
2010-05-27 13:25:40 +00:00
|
|
|
account_id: account.a_recv
|
|
|
|
address_contact_id: base.res_partner_address_zen
|
|
|
|
address_invoice_id: base.res_partner_address_zen
|
|
|
|
company_id: base.main_company
|
|
|
|
currency_id: base.EUR
|
|
|
|
date_invoice: '2010-05-26'
|
|
|
|
invoice_line:
|
|
|
|
- account_id: account.a_sale
|
|
|
|
name: '[PC3] Medium PC'
|
|
|
|
price_unit: 900.0
|
|
|
|
quantity: 10.0
|
|
|
|
product_id: product.product_product_pc3
|
|
|
|
uos_id: product.product_uom_unit
|
|
|
|
journal_id: account.sales_journal
|
|
|
|
partner_id: base.res_partner_3
|
|
|
|
reference_type: none
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I check that Initially customer invoice is in the "Draft" state
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!assert {model: account.invoice, id: account_invoice_customer0}:
|
2010-05-27 13:25:40 +00:00
|
|
|
- state == 'draft'
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I change the state of invoice to "Proforma2" by clicking PRO-FORMA button
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_customer0}
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I check that the invoice state is now "Proforma2"
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!assert {model: account.invoice, id: account_invoice_customer0}:
|
2010-05-27 13:25:40 +00:00
|
|
|
- state == 'proforma2'
|
|
|
|
-
|
|
|
|
I create invoice by clicking on Create button
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!workflow {model: account.invoice, action: invoice_open, ref: account_invoice_customer0}
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I check that the invoice state is "Open"
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!assert {model: account.invoice, id: account_invoice_customer0}:
|
2010-05-27 13:25:40 +00:00
|
|
|
- state == 'open'
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I create a record for partial payment of 1000 EUR.
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
|
|
|
!record {model: account.invoice.pay, id: account_invoice_pay_first0}:
|
|
|
|
amount: 1000.0
|
|
|
|
date: '2010-05-26'
|
|
|
|
journal_id: account.sales_journal
|
|
|
|
name: First payment for [PC3] Medium PC to Distrib PC
|
|
|
|
period_id: account.period_5
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I make partial payment by clicking on Partial Payment button
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
|
|
|
!python {model: account.invoice.pay}: |
|
|
|
|
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_first0")], {"lang":
|
|
|
|
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
2010-06-08 12:47:44 +00:00
|
|
|
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
2010-05-27 13:25:40 +00:00
|
|
|
})
|
|
|
|
-
|
|
|
|
I check that the invoice state is still open
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!assert {model: account.invoice, id: account_invoice_customer0}:
|
2010-05-27 13:25:40 +00:00
|
|
|
- state == 'open'
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I make second partial payment of 6000 EUR.
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
|
|
|
!record {model: account.invoice.pay, id: account_invoice_pay_second0}:
|
|
|
|
amount: 6000.0
|
|
|
|
date: '2010-05-28'
|
|
|
|
journal_id: account.sales_journal
|
|
|
|
name: Second payment for [PC3] Medium PC to Distrib PC
|
|
|
|
period_id: account.period_5
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I make partial payment by clicking on Partial Payment button
|
|
|
|
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
|
|
|
!python {model: account.invoice.pay}: |
|
|
|
|
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_second0")], {"lang":
|
|
|
|
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
2010-06-08 12:47:44 +00:00
|
|
|
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
2010-05-27 13:25:40 +00:00
|
|
|
})
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I make final partial payment of 2000 EUR
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
|
|
|
!record {model: account.invoice.pay, id: account_invoice_pay_final0}:
|
|
|
|
amount: 2000.0
|
|
|
|
date: '2010-05-30'
|
|
|
|
journal_id: account.sales_journal
|
|
|
|
name: Final payment for [PC3] Medium PC to Distrib PC
|
|
|
|
period_id: account.period_5
|
|
|
|
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
I make partial payment by clicking on Partial Payment button
|
|
|
|
|
2010-05-27 13:25:40 +00:00
|
|
|
-
|
|
|
|
!python {model: account.invoice.pay}: |
|
|
|
|
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_final0")], {"lang":
|
|
|
|
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
2010-06-08 12:47:44 +00:00
|
|
|
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
2010-05-27 13:25:40 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
-
|
|
|
|
I check that the invoice state is now Done
|
|
|
|
-
|
2010-06-08 12:47:44 +00:00
|
|
|
!assert {model: account.invoice, id: account_invoice_customer0}:
|
2010-05-27 13:25:40 +00:00
|
|
|
- state == 'paid'
|
|
|
|
-
|
|
|
|
I check that an payment entry gets created in the account.move.line
|
|
|
|
-
|
|
|
|
!python {model: account.invoice}: |
|
2010-06-08 12:47:44 +00:00
|
|
|
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
|
2010-05-27 13:25:40 +00:00
|
|
|
assert(acc_id.move_id)
|
2010-06-08 12:47:44 +00:00
|
|
|
-
|
|
|
|
I refund the invoice Using Credit Note
|
|
|
|
-
|
|
|
|
!record {model: account.invoice.refund, id: account_invoice_refund_0}:
|
|
|
|
description: Refund To China Export
|
|
|
|
period: account.period_5
|
|
|
|
-
|
|
|
|
I clicked on refund button
|
|
|
|
-
|
|
|
|
!python {model: account.invoice.refund}: |
|
|
|
|
self.invoice_refund(cr, uid, [ref("account_invoice_refund_0")], {"lang": 'en_US', "tz": False, "active_model": "account.invoice", "active_ids": [ref("account.account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account.account_invoice_customer0"), })
|
|
|
|
-
|
|
|
|
I checked that a new entry with state "Draft" created in account move line
|
|
|
|
|
2010-05-28 10:27:37 +00:00
|
|
|
|