Skip to content

Commit

Permalink
Merge 7456e9d into 933e1b6
Browse files Browse the repository at this point in the history
  • Loading branch information
charbeljc committed Jul 6, 2015
2 parents 933e1b6 + 7456e9d commit e84dd41
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ env:
matrix:
- LINT_CHECK="1"
- TRANSIFEX="1"
- TESTS="1" ODOO_REPO="odoo/odoo"
- TESTS="1" ODOO_REPO="OCA/OCB
- TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE="account_invoice_validation_workflow"
- TESTS="1" ODOO_REPO="OCA/OCB" EXCLUDE="account_invoice_validation_workflow"
- TESTS="1" ODOO_REPO="odoo/odoo" INCLUDE="account_invoice_validation_workflow" EXCLUDE="stock_picking_invoicing,invoice_fiscal_position_update,account_payment_term_extension,account_invoice_shipping_address,account_invoice_rounding,account_invoice_partner,account_invoice_merge,account_invoice_line_sort,account_invoice_line_description,account_invoice_force_number"
- TESTS="1" ODOO_REPO="OCA/OCB" INCLUDE="account_invoice_validation_workflow" EXCLUDE="stock_picking_invoicing,invoice_fiscal_position_update,account_payment_term_extension,account_invoice_shipping_address,account_invoice_rounding,account_invoice_partner,account_invoice_merge,account_invoice_line_sort,account_invoice_line_description,account_invoice_force_number"

virtualenv:
system_site_packages: true
Expand All @@ -30,6 +32,7 @@ install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
- pip install anybox.testing.openerp # needed for testing account_invoice_line_sort

script:
- travis_run_tests
Expand Down
2 changes: 1 addition & 1 deletion account_invoice_rounding/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
'license': 'AGPL-3',
'depends': ['account'],
'data': ['res_config_view.xml'],
'test': [],
'test': ['test/test_invoice_rounding.yml'],
'installable': True,
'auto_install': False,
'application': True,
Expand Down
90 changes: 90 additions & 0 deletions account_invoice_rounding/test/test_invoice_rounding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
-
I create a Tax Codes
-
!record {model: account.tax.code, id: tax_case}:
name: Tax_case
company_id: base.main_company
sign: 1
-
I create a Tax
-
!record {model: account.tax, id: tax10}:
name: Tax 10.0
amount: 10.0
type: fixed
sequence: 1
company_id: base.main_company
type_tax_use: all
tax_code_id: tax_case
-
In order to test invoice rounding, I configure rounding method to swedish round globally
- !python {model: res.company, id: base.main_company}: |
self.tax_calculation_rounding = 0.05
self.tax_calculation_rounding_method = 'swedish_round_globally'
-
In order to test that an invoice is correctly rounded down, I configure an invoice.
-
!record {model: account.invoice, id: invoice_round_down}:
account_id: account.a_recv
company_id: base.main_company
currency_id: base.EUR
invoice_line:
- account_id: account.a_sale
name: '[PCSC234] PC Assemble SC234'
price_unit: 100.02
quantity: 1.0
product_id: product.product_product_3
uos_id: product.product_uom_unit
invoice_line_tax_id:
- tax10
journal_id: account.bank_journal
partner_id: base.res_partner_12
reference_type: none
-
I check that Initially customer invoice state is "Draft"
-
!assert {model: account.invoice, id: invoice_round_down}:
- state == 'draft'
-
I call the workflow "invoice_open"
-
!workflow {model: account.invoice, action: invoice_open, ref: invoice_round_down}
-
I check that the invoice state is "open" and the total amount is 110.00
-
!assert {model: account.invoice, id: invoice_round_down, string: Invoce is in open state}:
- state == 'open'
- amount_total == 110.00
-
In order to test that an invoice is correctly rounded up, I configure
an invoice.
-
!record {model: account.invoice, id: invoice_round_up}:
account_id: account.a_recv
company_id: base.main_company
currency_id: base.EUR
invoice_line:
- account_id: account.a_sale
name: '[PCSC234] PC Assemble SC234'
price_unit: 100.04
quantity: 1.0
product_id: product.product_product_3
uos_id: product.product_uom_unit
invoice_line_tax_id:
- tax10
journal_id: account.bank_journal
partner_id: base.res_partner_12
reference_type: none
-
I check that Initially customer invoice state is "Draft"
-
!assert {model: account.invoice, id: invoice_round_up}:
- state == 'draft'
-
!workflow {model: account.invoice, action: invoice_open, ref: invoice_round_up}
-
I check that the invoice state is "open" and the total amount is 110.05
-
!assert {model: account.invoice, id: invoice_round_up, string: Invoce is in open state}:
- state == 'open'
- amount_total == 110.05
2 changes: 1 addition & 1 deletion stock_picking_invoicing/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
"data": [
"stock_view.xml",
],
"installable": True
"installable": False
}

0 comments on commit e84dd41

Please sign in to comment.