Skip to content

Commit

Permalink
[FIX] l10n_br_sale: Cases without Fiscal Operation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbcosta committed Feb 6, 2025
1 parent c463a3c commit 53e00fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion l10n_br_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ class SaleOrder(models.Model):

@api.model
def _default_fiscal_operation(self):
return self.env.company.sale_fiscal_operation_id
# O IF permite testar casos Sem OP Fiscal, por exemplo o módulo delivery
# TODO: Avaliar a necessidade do IF depois da separação entre
# os Testes e os Dados de Demonstração
if self.env.company.country_id.code == "BR":
return self.env.company.sale_fiscal_operation_id

@api.model
def _default_copy_note(self):
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_sale/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SaleOrderLine(models.Model):

@api.model
def _default_fiscal_operation(self):
return self.env.company.sale_fiscal_operation_id
return self.order_id.fiscal_operation_id

@api.model
def _fiscal_operation_domain(self):
Expand Down

0 comments on commit 53e00fb

Please sign in to comment.