From 6e56609846cb10e61d690fd0d86133c115a481f8 Mon Sep 17 00:00:00 2001 From: Marc Durepos Date: Thu, 5 Dec 2024 13:22:12 -0500 Subject: [PATCH] fix active_ids bug for single selection in price update notification module --- .../wizard/send_price_update_notice.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/price_update_notifications/wizard/send_price_update_notice.py b/price_update_notifications/wizard/send_price_update_notice.py index 233b229..1675947 100644 --- a/price_update_notifications/wizard/send_price_update_notice.py +++ b/price_update_notifications/wizard/send_price_update_notice.py @@ -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: