fix active_ids bug for single selection in price update notification module

This commit is contained in:
Marc Durepos 2024-12-05 13:22:12 -05:00
parent a968b64e80
commit 6e56609846

View file

@ -27,9 +27,10 @@ class SendPriceUpdateNotice(models.TransientModel):
def default_get(self, fields):
vals = {}
if "partner_ids" in fields:
partners = self.env["res.partner"].search(
[("id", "in", self.env.context.get("active_ids"))]
)
active_ids = self.env.context.get("active_ids") or [
self.env.context.get("active_id")
]
partners = self.env["res.partner"].search([("id", "in", active_ids)])
if no_email_partners := partners.filtered(lambda p: not p.email):
warning_msg = self._get_warning_message(no_email_partners)
else: