price_update_notifications: add mail.activity.mixin to notices

This commit is contained in:
Marc Durepos 2024-12-17 16:06:03 -05:00
parent 57c938bb8d
commit f3a7072314
2 changed files with 9 additions and 7 deletions

View file

@ -19,7 +19,7 @@
# #
{ {
"name": "Price Update Notifications", "name": "Price Update Notifications",
"version": "17.0.1.0.0", "version": "17.0.1.0.1",
"summary": "Send a price update notification to clients", "summary": "Send a price update notification to clients",
"category": "Sale", "category": "Sale",
"author": "Bemade Inc.", "author": "Bemade Inc.",

View file

@ -6,7 +6,7 @@ from datetime import timedelta
class PriceNoticeMailing(models.Model): class PriceNoticeMailing(models.Model):
_name = "price.notice.mailing" _name = "price.notice.mailing"
_description = "Price Notice Mailing" _description = "Price Notice Mailing"
_inherit = ["mail.thread"] _inherit = ["mail.thread", "mail.activity.mixin"]
partner_id = fields.Many2one("res.partner", required=True, readonly=True) partner_id = fields.Many2one("res.partner", required=True, readonly=True)
email = fields.Char(readonly=True) email = fields.Char(readonly=True)
@ -85,11 +85,13 @@ class PriceNoticeMailing(models.Model):
), ),
] ]
if self.product_template_ids: if self.product_template_ids:
so_domain = [( so_domain = [
"order_line.product_template_id", (
"in", "order_line.product_template_id",
self.product_template_ids.ids, "in",
)] + so_domain self.product_template_ids.ids,
)
] + so_domain
sale_ids = self.env["sale.order"].search(so_domain) sale_ids = self.env["sale.order"].search(so_domain)
# Retrieve purchased products and limit to the selected product # Retrieve purchased products and limit to the selected product