Skip to content

Commit

Permalink
[FIX] l10n_pt_stock_invoicexpress: not sending Delivery emails when I…
Browse files Browse the repository at this point in the history
…nvoiceXpress was disabled
  • Loading branch information
dreispt committed Jun 2, 2023
1 parent 82f8073 commit c6378cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions l10n_pt_stock_invoicexpress/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ def _compute_invoicexpress_doc_type(self):

def _send_confirmation_email(self):
# Only send Delivery emails if the InvoiceXpress checkbox is selected
to_send = self.filtered("invoicexpress_send_email")
super(StockPicking, to_send)._send_confirmation_email()
dont_send = self.filtered(
lambda x: x.can_invoicexpress and not x.invoicexpress_send_email
)
super(StockPicking, self - dont_send)._send_confirmation_email()

@api.model
def _get_invoicexpress_prefix(self, doctype):
Expand Down

0 comments on commit c6378cd

Please sign in to comment.