fix active_ids bug for single selection in price update notification module
This commit is contained in:
parent
a968b64e80
commit
6e56609846
1 changed files with 4 additions and 3 deletions
|
|
@ -27,9 +27,10 @@ class SendPriceUpdateNotice(models.TransientModel):
|
||||||
def default_get(self, fields):
|
def default_get(self, fields):
|
||||||
vals = {}
|
vals = {}
|
||||||
if "partner_ids" in fields:
|
if "partner_ids" in fields:
|
||||||
partners = self.env["res.partner"].search(
|
active_ids = self.env.context.get("active_ids") or [
|
||||||
[("id", "in", self.env.context.get("active_ids"))]
|
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):
|
if no_email_partners := partners.filtered(lambda p: not p.email):
|
||||||
warning_msg = self._get_warning_message(no_email_partners)
|
warning_msg = self._get_warning_message(no_email_partners)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue