Skip to content

Commit

Permalink
Merge PR #3288 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by rvalyi
  • Loading branch information
OCA-git-bot committed Aug 18, 2024
2 parents 645ecd5 + 578839a commit f48721c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
2 changes: 2 additions & 0 deletions l10n_br_purchase_stock/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def _prepare_picking(self):
values = super()._prepare_picking()
if self.fiscal_operation_id:
values.update(self._prepare_br_fiscal_dict())
else:
values["fiscal_operation_id"] = False
if self.company_id.purchase_invoicing_policy == "stock_picking":
values["invoice_state"] = "2binvoiced"

Expand Down
20 changes: 0 additions & 20 deletions l10n_br_stock_account/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@ def _default_fiscal_operation(self):
else company.stock_out_fiscal_operation_id
)

# Casos onde o usuário definiu o Pedido de Compra/Venda como
# 'Sem Operação Fiscal'
if hasattr(self, "purchase_id") and hasattr(
self.purchase_id, "fiscal_operation_id"
):
if not self.purchase_id.fiscal_operation_id:
fiscal_operation = False
if hasattr(self, "sale_id") and hasattr(
self.sale_id, "fiscal_operation_id"
):
# Necessário para evitar o erro quando o l10n_br_purchase_stock
# é instalado:
# /l10n_br_stock_account/models/stock_picking.py", line 34,
# in _default_fiscal_operation
# if not self.sale_id.fiscal_operation_id:
# AttributeError: 'sale.order' object has no attribute
# 'fiscal_operation_id'
if not self.sale_id.fiscal_operation_id:
fiscal_operation = False

return fiscal_operation

@api.model
Expand Down

0 comments on commit f48721c

Please sign in to comment.