
-
  Creating a tax record
-
  !record {model: account.tax, id: account_tax_a0}:
    amount: 0.10000000000000001
    applicable_type: 'true'
    company_id: base.main_company
    description: a
    name: a
    sequence: 1
    type: percent
    type_tax_use: all

-
  Creating a account invoice record with tax excluded
-
  !record {model: account.invoice, id: account_invoice_tax_exclude}:
    account_id: account.a_recv
    address_contact_id: base.res_partner_address_3000
    address_invoice_id: base.res_partner_address_3000
    company_id: base.main_company
    currency_id: base.EUR
    invoice_line:
      - account_id: account.a_sale
        name: '[PC1] Basic PC'
        price_unit: 100.0
        quantity: 1.0
        invoice_line_tax_id:
          - account_tax_a0
        product_id: product.product_product_pc1
        uos_id: product.product_uom_unit
    journal_id: account.sales_journal
    partner_id: base.res_partner_desertic_hispafuentes
    price_type: tax_excluded
    reference_type: none

-
  Performing an osv_memory action button_reset_taxes on module account.invoice
-
  !python {model: account.invoice}: |
    self.button_reset_taxes(cr, uid, [ref("account_invoice_tax_exclude")], {"lang": "en_US", "tz": False,
      "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_invoice_tree1")],
      "type": "out_invoice", "active_id": ref("account.menu_action_invoice_tree1"),
      })
-
  Check if tax is excluded in invoice
-
  !assert {model: account.invoice, id: account_invoice_tax_exclude, severity: error, string: price type is tax excluded}:
       - state == "draft"
       - amount_untaxed == 100.0
       - amount_tax == 10.0
       - amount_total == 110.0

-
  Creating a account invoice record with tax include
-
  !record {model: account.invoice, id: account_invoice_tax_include}:
    account_id: account.a_recv
    address_contact_id: base.res_partner_address_3000
    address_invoice_id: base.res_partner_address_3000
    company_id: base.main_company
    currency_id: base.EUR
    invoice_line:
      - account_id: account.a_sale
        name: '[PC1] Basic PC'
        price_unit: 100.0
        quantity: 1.0
        invoice_line_tax_id:
          - account_tax_a0
        product_id: product.product_product_pc1
        uos_id: product.product_uom_unit
    journal_id: account.sales_journal
    partner_id: base.res_partner_desertic_hispafuentes
    price_type: tax_included
    reference_type: none

-
  Performing an osv_memory action button_reset_taxes on module account.invoice
-
  !python {model: account.invoice}: |
    self.button_reset_taxes(cr, uid, [ref("account_invoice_tax_include")], {"lang": "en_US", "tz": False,
      "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_invoice_tree1")],
      "type": "out_invoice", "active_id": ref("account.menu_action_invoice_tree1"),
      })
-
  Check if tax is included in invoice
-
  !assert {model: account.invoice, id: account_invoice_tax_include, severity: error, string: price type is tax included}:
       - state == "draft"
       - amount_untaxed == 90.91
       - amount_tax == 9.09
       - amount_total == 100.00