Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] l10n_br_sale_stock: Caso do Pedido de Venda Sem Operação ou Internacional não deve incluir os Dados Fiscais do Brasil #3325

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion l10n_br_sale_stock/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

def _prepare_procurement_values(self, group_id=False):
values = self._prepare_br_fiscal_dict()
values = {}
if self.order_id.fiscal_operation_id:
values = self._prepare_br_fiscal_dict()
values.update(super()._prepare_procurement_values(group_id))
# Incluir o invoice_state
if self.order_id.company_id.sale_create_invoice_policy == "stock_picking":
Expand Down
5 changes: 3 additions & 2 deletions l10n_br_sale_stock/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ def _get_new_picking_values(self):
values = {}
fiscal_operation = False
if self.sale_line_id:
values = self.sale_line_id.order_id._prepare_br_fiscal_dict()
fiscal_operation = self.sale_line_id.order_id.fiscal_operation_id
if self.sale_line_id.order_id.fiscal_operation_id:
fiscal_operation = self.sale_line_id.order_id.fiscal_operation_id
values = self.sale_line_id.order_id._prepare_br_fiscal_dict()

values.update(super()._get_new_picking_values())
# O self pode conter mais de uma stock.move por isso a Operação Fiscal
Expand Down
Loading