Skip to content

Commit

Permalink
Merge PR OCA#1845 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 18, 2024
2 parents ac386b4 + 1d8b0fe commit a7943cc
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 @@ -43,6 +43,7 @@ def _send_invoice_individually(self, template=None):
{
"active_model": self._name,
"active_ids": self.ids,
"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 a7943cc

Please sign in to comment.