Skip to content

Commit

Permalink
Merge PR #3282 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 15, 2024
2 parents 02dd890 + 099772c commit e33bc2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion l10n_br_purchase_stock/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def _compute_get_button_create_invoice_invisible(self):
@api.model
def _prepare_picking(self):
values = super()._prepare_picking()
values.update(self._prepare_br_fiscal_dict())
if self.fiscal_operation_id:
values.update(self._prepare_br_fiscal_dict())
if self.company_id.purchase_create_invoice_policy == "stock_picking":
values["invoice_state"] = "2binvoiced"

Expand Down
5 changes: 3 additions & 2 deletions l10n_br_purchase_stock/models/purchase_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ def _prepare_stock_moves(self, picking):
"""
values = super()._prepare_stock_moves(picking)
for v in values:
v.update(self._prepare_br_fiscal_dict())
if self.env.company.purchase_create_invoice_policy == "stock_picking":
if self.order_id.fiscal_operation_id:
v.update(self._prepare_br_fiscal_dict())
if self.order_id.purchase_create_invoice_policy == "stock_picking":
v["invoice_state"] = "2binvoiced"
return values

Expand Down

0 comments on commit e33bc2c

Please sign in to comment.