Skip to content

Commit

Permalink
[FIX]"View Invoice" button in service modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sadamo committed Jul 10, 2017
1 parent 071bdc8 commit fb7d65f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion l10n_br_account_product_service/models/account_invoice.py
Expand Up @@ -88,7 +88,7 @@ def fields_view_get(self, view_id=None, view_type='form',
'l10n_br_account_service_nfse_tree')
nfse_views = {'form': nfse_form, 'tree': nfse_tree}

if active_id:
if active_id and context.get('active_model') == 'account.invoice':
invoice = self.browse(active_id)
fiscal_document_code = invoice.fiscal_document_id.code

Expand Down
2 changes: 1 addition & 1 deletion l10n_br_account_service/models/account_invoice.py
Expand Up @@ -90,7 +90,7 @@ def fields_view_get(self, view_id=None, view_type='form',
'l10n_br_account_service_nfse_tree')
nfse_views = {'form': nfse_form, 'tree': nfse_tree}

if active_id:
if active_id and context.get('active_model') == 'account.invoice':
invoice = self.browse(active_id)
fiscal_document_code = invoice.fiscal_document_id.code

Expand Down

0 comments on commit fb7d65f

Please sign in to comment.