summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMustufa Rangwala <mra@mra-laptop>2010-06-10 09:50:56 +0530
committerMustufa Rangwala <mra@mra-laptop>2010-06-10 09:50:56 +0530
commit235cc31796d84ce28aa660bcbfc34bcdfe6dfd94 (patch)
tree84506da3b243aa8068e1025b7d9d112520a8c5ff
parent4b4d9135ca8d89ae979b6a373e8d252c720f547d (diff)
parentafd7efa9317141dcea882f414ddbe8dd21adbb4b (diff)
[MERGE] merge psi branch for yaml account_tax_include
bzr revid: mra@mra-laptop-20100610042056-2rxt847jrijxbto8
-rw-r--r--addons/account_tax_include/__openerp__.py1
-rw-r--r--addons/account_tax_include/test/account_tax_include.yml93
2 files changed, 94 insertions, 0 deletions
diff --git a/addons/account_tax_include/__openerp__.py b/addons/account_tax_include/__openerp__.py
index 5bb1a2e2399..a963b0b5118 100644
--- a/addons/account_tax_include/__openerp__.py
+++ b/addons/account_tax_include/__openerp__.py
@@ -35,6 +35,7 @@ This module implement the modification on the invoice form.
'init_xml': [],
'update_xml': ['account_tax_include_view.xml'],
'demo_xml': [],
+ 'test': ['test/account_tax_include.yml'],
'installable': True,
'active': False,
'certificate': '0070514190381',
diff --git a/addons/account_tax_include/test/account_tax_include.yml b/addons/account_tax_include/test/account_tax_include.yml
new file mode 100644
index 00000000000..a4b0f8531b9
--- /dev/null
+++ b/addons/account_tax_include/test/account_tax_include.yml
@@ -0,0 +1,93 @@
+
+-
+ 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 \ No newline at end of file