2 In order to test account invoice i create a new supplier invoice
4 Creating a account.invoice record
6 !record {model: account.invoice, id: account_invoice_1}:
7 account_id: account.a_pay
8 address_contact_id: base.res_partner_address_3000
9 address_invoice_id: base.res_partner_address_3000
11 company_id: base.main_company
14 - account_id: account.a_expense
15 name: '[PC1] Basic PC'
17 product_id: product.product_product_pc1
19 uos_id: product.product_uom_unit
20 journal_id: account.expenses_journal
21 partner_id: base.res_partner_desertic_hispafuentes
25 I check that Initially supplier invoice is in the draft state
27 !assert {model: account.invoice, id: account_invoice_1}:
30 I change the state of invoice to open by clicking Validate button
32 Performing a workflow action invoice_open on module account.invoice
34 !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_1}
36 I check that the invoice state is now open
38 !assert {model: account.invoice, id: account_invoice_1}:
41 I make a partial payment of 2000 by clicking on Pay Invoice button
43 Creating a account.invoice.pay record
45 !record {model: account.invoice.pay, id: account_invoice_pay_firstpaymenttoaxelorforbasicpc0}:
48 journal_id: account.sales_journal
49 name: First Payment to Axelor for Basic PC
50 period_id: account.period_5
53 Performing an osv_memory action pay_and_reconcile on module account.invoice.pay
55 !python {model: account.invoice.pay}: |
56 self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_firstpaymenttoaxelorforbasicpc0")],
57 {"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id":
58 25, "active_ids": [ref("account_invoice_1")], "type": "in_invoice", "active_id":
59 ref("account_invoice_1"), })
61 I check that the invoice state is still open
63 !assert {model: account.invoice, id: account_invoice_1}:
66 I make final partial payment of 1000 by clicking on Pay Invoice button
68 Creating a account.invoice.pay record
70 !record {model: account.invoice.pay, id: account_invoice_pay_finalpaymenttoaxelorforbasicpc0}:
73 journal_id: account.sales_journal
74 name: Final Payment to Axelor for Basic PC
75 period_id: account.period_5
79 Performing an osv_memory action pay_and_reconcile on module account.invoice.pay
81 !python {model: account.invoice.pay}: |
82 self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_finalpaymenttoaxelorforbasicpc0")],
83 {"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id":
84 25, "active_ids": [ref("account_invoice_1")], "type": "in_invoice", "active_id":
85 ref("account_invoice_1"), })
88 I check that the invoice state is now Done
90 !assert {model: account.invoice, id: account_invoice_1}:
93 I check that an payment entry gets created in the account.move.line
95 !python {model: account.invoice}: |
96 acc_id=self.browse(cr, uid, ref("account_invoice_1"))
97 assert(acc_id.move_id)
99 # I refund the invoice
101 # Creating a account.invoice.refund record
103 # !record {model: account.invoice.refund, id: account_invoice_refund_0}:
105 # description: 'Refund By Axelor '
109 # Performing an osv_memory action invoice_refund on module account.invoice.refund
111 # !python {model: account.invoice.refund}: |
112 # self.invoice_refund(cr, uid, [ref("account_invoice_refund_0")], {"lang": 'en_US',
113 # "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_1")],
114 # "type": "in_invoice", "active_id": ref("account_invoice_1"), })