Skip to content

Commit

Permalink
Merge ed2013d into 5094878
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonlima committed May 28, 2016
2 parents 5094878 + ed2013d commit ae66bc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion l10n_br_account_product/models/l10n_br_account_product.py
Expand Up @@ -168,7 +168,7 @@ def _check_ie(self):
"""
check_ie = True

if self.inscr_est or self.inscr_est != 'ISENTO':
if self.inscr_est and self.inscr_est != 'ISENTO':
uf = self.state_id and self.state_id.code.lower() or ''
try:
mod = __import__('openerp.addons.l10n_br_base.tools.fiscal',
Expand Down
7 changes: 6 additions & 1 deletion l10n_br_base/models/res_partner.py
Expand Up @@ -136,7 +136,12 @@ def _check_ie(self):
:Parameters:
"""
result = True
if self.inscr_est == 'ISENTO' or self.is_company:
if ((self.inscr_est and self.inscr_est != 'ISENTO')
and (self.inscr_est.upper() == 'ISENTA' or
self.inscr_est.upper() == 'ISENTO')):
self.inscr_est = 'ISENTO'

if self.inscr_est != 'ISENTO' and self.is_company:
state_code = self.state_id.code or ''
uf = state_code.lower()
result = self._validate_ie_param(uf, self.inscr_est)
Expand Down
8 changes: 7 additions & 1 deletion l10n_br_crm/models/crm_lead.py
Expand Up @@ -75,7 +75,13 @@ def _check_ie(self):
:Return: True or False.
"""
result = True
if self.inscr_est != 'ISENTO' or self.partner_name:

if ((self.inscr_est and self.inscr_est != 'ISENTO')
and (self.inscr_est.upper() == 'ISENTA' or
self.inscr_est.upper() == 'ISENTO')):
self.inscr_est = 'ISENTO'

if self.inscr_est and self.inscr_est != 'ISENTO':
state_code = self.state_id.code or ''
uf = state_code.lower()
try:
Expand Down

0 comments on commit ae66bc2

Please sign in to comment.