186
186
- amount_tax == 82.26
189
190
In order to test tax computation I create a new customer invoice
191
!record {model: account.invoice, id: account_invoice_customer4}:
192
account_id: account.a_recv
193
address_contact_id: base.res_partner_address_zen
194
address_invoice_id: base.res_partner_address_zen
195
company_id: base.main_company
196
currency_id: base.EUR
197
date_invoice: !eval time.strftime('%Y-%m-%d')
200
- account_id: account.a_sale
206
- account_id: account.a_sale
212
journal_id: account.sales_journal
213
partner_id: base.res_partner_3
192
#!record {model: account.invoice, id: account_invoice_customer4}:
193
#account_id: account.a_recv
194
#address_contact_id: base.res_partner_address_zen
195
#address_invoice_id: base.res_partner_address_zen
196
#company_id: base.main_company
197
#currency_id: base.EUR
198
#date_invoice: !eval time.strftime('%Y-%m-%d')
201
#- account_id: account.a_sale
205
#invoice_line_tax_id:
206
#- account_tax_20_inc
207
#- account_id: account.a_sale
211
#invoice_line_tax_id:
212
#- account_tax_20_inc
213
#journal_id: account.sales_journal
214
#partner_id: base.res_partner_3
216
Compute the total tax.
218
!python {model: account.invoice}: |
219
self.button_compute(cr, uid, [ref("account_invoice_customer4")])
221
Then I verify the amount.
222
148.28 + 148.28 = 296.56
223
296.56 ÷ 1.2 = 247.133333333 = 247.13
224
296.56 - 247.13 = 49.43
226
!assert {model: account.invoice, id: account_invoice_customer4}:
227
- amount_tax == 49.43
217
#Compute the total tax.
219
#!python {model: account.invoice}: |
220
#self.button_compute(cr, uid, [ref("account_invoice_customer4")])
222
#Then I verify the amount.
223
#148.28 + 148.28 = 296.56
224
#296.56 ÷ 1.2 = 247.133333333 = 247.13
225
#296.56 - 247.13 = 49.43
227
#!assert {model: account.invoice, id: account_invoice_customer4}:
228
#- amount_tax == 49.43