Skip to content

Commit

Permalink
Merge PR #1846 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 15, 2024
2 parents 8903b8e + d5d0a87 commit a4993fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions account_invoice_mass_sending/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _send_invoice_individually(self, template=None):
"active_ids": self.ids,
"active_id": self.id,
"discard_logo_check": True,
"account_invoice_mass_sending": True,
}
)
wiz = self.env["account.invoice.send"].with_context(**wiz_ctx).create({})
Expand Down
11 changes: 10 additions & 1 deletion account_invoice_mass_sending/wizards/account_invoice_send.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, models
from odoo import _, api, models


class AccountInvoiceSend(models.TransientModel):
Expand Down Expand Up @@ -48,3 +48,12 @@ def enqueue_invoices(self):
}
)
return notification

@api.onchange("invoice_ids")
def _compute_composition_mode(self):
"""Force send as mass_mail although this module sends each invoice one by one
to avoid extra notificactions"""
if not self.env.context.get("account_invoice_mass_sending", False):
return super()._compute_composition_mode()
for wizard in self:
wizard.composer_id.composition_mode = "mass_mail"

0 comments on commit a4993fe

Please sign in to comment.