Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][BP] account_invoice_mass_sending: Users have extra notifications when the invoice has sent by the job #1845

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading