Skip to content

Commit

Permalink
[FIX] l10n_ve_fiscal_requirements: Solved issue when get accounting p…
Browse files Browse the repository at this point in the history
…artner in VAT Mandatory constraint
  • Loading branch information
suniagajose committed Dec 17, 2015
1 parent f1c71e7 commit ce4a44f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion l10n_ve_fiscal_requirements/model/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ def _check_vat_mandatory(self, cr, uid, ids, context=None):
return True

for rp_brw in self.browse(cr, uid, ids):
acc_part_brw = self._find_accounting_partner(rp_brw)
# not use find_accounting_partner function at this point
# because return false. Theorically can't be false
acc_part_brw = rp_brw
while not acc_part_brw.is_company and acc_part_brw.parent_id:
acc_part_brw = acc_part_brw.parent_id
if (acc_part_brw.country_id and
acc_part_brw.country_id.code != 'VE'):
continue
Expand Down
4 changes: 2 additions & 2 deletions l10n_ve_fiscal_requirements/test/fr_vat_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
part_id = self.create(cr, uid, part)
assert part_id, 'Partner should be created'
-
#-
# 5.3 I create a partner with the same vat and different name than 5.2 previous and this should fail
#-
# !python {model: res.partner}: |
Expand All @@ -65,7 +65,7 @@
# except orm.except_orm:
# pass
# assert not part_id, 'Another Partner with the same VAT number than other should not be created'
#-
-
5.4 I create a partner with no VAT number this should fail
-
!python {model: res.partner}: |
Expand Down

0 comments on commit ce4a44f

Please sign in to comment.