Skip to content

Commit

Permalink
[FIX] l10n_ve_withholding_islr: Uncomment data demo to solve unittest…
Browse files Browse the repository at this point in the history
… issues
  • Loading branch information
suniagajose committed Dec 17, 2015
1 parent ce4a44f commit 5c339bf
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 41 deletions.
3 changes: 3 additions & 0 deletions l10n_ve_withholding_islr/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"product",
"report_webkit",
],
'demo': [
'demo/l10n_ve_islr_withholding_demo.xml',
],
"data": [
"view/installer.xml",
"security/wh_islr_security.xml",
Expand Down
6 changes: 2 additions & 4 deletions l10n_ve_withholding_islr/demo/l10n_ve_islr_withholding_demo.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@
<field name="user_type" ref="account.data_account_type_liability"/>
</record>

<!-- TODO: Remove 'islr.wh.concept' records once have been made a functional check -->
<!--Concepts
Just adding accounts to concepts to be able to execute the withholding
-->
<!--
<record id="islr_wh_concept_hprof_no_mercantiles" model="islr.wh.concept">
<field name="property_retencion_islr_payable" ref="islr_pay"/>
<field name="property_retencion_islr_receivable" ref="islr_rec"/>
Expand Down Expand Up @@ -193,8 +191,8 @@
<field name="property_retencion_islr_payable" ref="islr_pay"/>
<field name="property_retencion_islr_receivable" ref="islr_rec"/>
</record>
-->
<!--Sequence-->

<!-- Sequence -->
<record id="seq_wh_islr_purchase_type" model="ir.sequence.type">
<field name="name">Retencion de ISLR Compra</field>
<field name="code">account.journal.islr.purchase</field>
Expand Down
36 changes: 18 additions & 18 deletions l10n_ve_withholding_islr/test/supplier_wh_islr_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
iwc_ids = self.search(cr, uid, [( 'withholdable', '=', False )])
assert len(iwc_ids) == 1, ( 'Only can be defined one non-withhodeable'
' concepts, but %s are defined.' % (len(iwc_ids), ))
#-
# I check that all the withholdable concepts have accounts type 'other'
# associtated and also have mandatory income rates.
#-
# !python {model: islr.wh.concept}: |
# iwc_ids = self.search(cr, uid, [( 'withholdable', '=', True )])
# for iwc_brw in self.browse(cr, uid, iwc_ids):
# assert iwc_brw.rate_ids, 'All the withholdable concepts need to have rates associated'
# assert iwc_brw.property_retencion_islr_payable, 'All the withholdable concepts need to have an income withholding purchase acc set.'
# assert iwc_brw.property_retencion_islr_payable.type == 'other', 'All the withholdable concepts need to have an income withholding purchase acc of type other.'
# assert iwc_brw.property_retencion_islr_receivable, 'All the withholdable concepts need to have an income withholding sale acc set.'
# assert iwc_brw.property_retencion_islr_receivable.type == 'other', 'All the withholdable concepts need to have an income withholding sale acc of type other.'
-
I check that all the withholdable concepts have accounts type 'other'
associtated and also have mandatory income rates.
-
!python {model: islr.wh.concept}: |
iwc_ids = self.search(cr, uid, [( 'withholdable', '=', True )])
for iwc_brw in self.browse(cr, uid, iwc_ids):
assert iwc_brw.rate_ids, 'All the withholdable concepts need to have rates associated'
assert iwc_brw.property_retencion_islr_payable, 'All the withholdable concepts need to have an income withholding purchase acc set.'
assert iwc_brw.property_retencion_islr_payable.type == 'other', 'All the withholdable concepts need to have an income withholding purchase acc of type other.'
assert iwc_brw.property_retencion_islr_receivable, 'All the withholdable concepts need to have an income withholding sale acc set.'
assert iwc_brw.property_retencion_islr_receivable.type == 'other', 'All the withholdable concepts need to have an income withholding sale acc of type other.'
-
I check that the supplier that will be use is income withholdable.
-
Expand All @@ -45,11 +45,11 @@
-
!assert {model: islr.wh.concept, id: islr_wh_concept_hprof_no_mercantiles, string: The income concept is not withholdable}:
- withholdable
#-
# I check that the product that will be use have a concept.
#-
# !assert {model: product.product, id: product.product_product_4, string: Have not a concept.}:
# - concept_id
-
I check that the product that will be use have a concept.
-
!assert {model: product.product, id: product.product_product_4, string: Have not a concept.}:
- concept_id
-
2.2 I check that one invoice only creates a single one withholding line.
-
Expand All @@ -69,7 +69,7 @@
uos_id: product.product_uom_unit
price_unit: 3000
account_id: account.a_pay
concept_id: islr_wh_concept_hprof_no_mercantiles
# concept_id: islr_wh_concept_hprof_no_mercantiles # (already in product)
-
I check that the invoice was correctly created.
-
Expand Down
38 changes: 19 additions & 19 deletions l10n_ve_withholding_islr/test/supplier_wh_islr_invoice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
iwc_ids = self.search(cr, uid, [( 'withholdable', '=', False )])
assert len(iwc_ids) == 1, ( 'Only can be defined one non-withhodeable'
' concepts, but %s are defined.' % (len(iwc_ids), ))
#-
# I check that all the withholdable concepts have accounts type 'other' associtated and also have mandatory income rates.
#-
# !python {model: islr.wh.concept}: |
# iwc_ids = self.search(cr, uid, [( 'withholdable', '=', True )])
# for iwc_brw in self.browse(cr, uid, iwc_ids):
# assert iwc_brw.rate_ids, 'All the withholdable concepts need to have rates associated'
# assert iwc_brw.property_retencion_islr_payable, 'All the withholdable concepts need to have an income withholding purchase acc set.'
# assert iwc_brw.property_retencion_islr_payable.type == 'other', 'All the withholdable concepts need to have an income withholding purchase acc of type other.'
# assert iwc_brw.property_retencion_islr_receivable, 'All the withholdable concepts need to have an income withholding sale acc set.'
# assert iwc_brw.property_retencion_islr_receivable.type == 'other', 'All the withholdable concepts need to have an income withholding sale acc of type other.'
-
I check that all the withholdable concepts have accounts type 'other' associtated and also have mandatory income rates.
-
!python {model: islr.wh.concept}: |
iwc_ids = self.search(cr, uid, [( 'withholdable', '=', True )])
for iwc_brw in self.browse(cr, uid, iwc_ids):
assert iwc_brw.rate_ids, 'All the withholdable concepts need to have rates associated'
assert iwc_brw.property_retencion_islr_payable, 'All the withholdable concepts need to have an income withholding purchase acc set.'
assert iwc_brw.property_retencion_islr_payable.type == 'other', 'All the withholdable concepts need to have an income withholding purchase acc of type other.'
assert iwc_brw.property_retencion_islr_receivable, 'All the withholdable concepts need to have an income withholding sale acc set.'
assert iwc_brw.property_retencion_islr_receivable.type == 'other', 'All the withholdable concepts need to have an income withholding sale acc of type other.'
-
I check that the supplier that will be use exist and is correctly set for this test.
-
Expand All @@ -47,12 +47,12 @@
-
!assert {model: islr.wh.concept, id: islr_wh_concept_hprof_no_mercantiles, string: The income concept is not withholdable}:
- withholdable
#-
# I check that the product that will be use have the withholdable concept.
#-
# !assert {model: product.product, id: product.product_product_4, string: Have not a concept.}:
# - concept_id
# - concept_id.id == ref( 'islr_wh_concept_hprof_no_mercantiles' )
-
I check that the product that will be use have the withholdable concept.
-
!assert {model: product.product, id: product.product_product_4, string: Have not a concept.}:
- concept_id
- concept_id.id == ref( 'islr_wh_concept_hprof_no_mercantiles' )
-
1.2 I check that a withholding document is created when the invoice have a withholdable concept (at the invoice line product).
-
Expand All @@ -72,7 +72,7 @@
uos_id: product.product_uom_unit
price_unit: 30000
account_id: account.a_pay
concept_id: islr_wh_concept_hprof_no_mercantiles
# concept_id: islr_wh_concept_hprof_no_mercantiles # (already in product)
-
I check that the invoice was correctly created.
-
Expand All @@ -88,7 +88,7 @@
-
I check that the invoice is confirmed and it genarate a draft income withholding.
-
!assert {model: account.invoice, id: islr_withholdable_supplier_invoice, string: The invoice was not confirmed}:
!assert {model: account.invoice, id: islr_withholdable_supplier_invoice, string: The invoice was not confirmed or the withholding document wasn't created}:
- state == 'open'
- islr_wh_doc_id
- islr_wh_doc_id.state == 'draft'
Expand Down

0 comments on commit 5c339bf

Please sign in to comment.