From 14a8831219bcb2d4a1fabad43f5137ba96c22540 Mon Sep 17 00:00:00 2001 From: Daniil Digtyar Vasilieva Date: Thu, 14 Dec 2023 12:35:53 +0100 Subject: [PATCH] [IMP] cooperator: domain to get only mail template of partners --- cooperator/models/product.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cooperator/models/product.py b/cooperator/models/product.py index 49d3a4b0e..b56ee872b 100644 --- a/cooperator/models/product.py +++ b/cooperator/models/product.py @@ -17,7 +17,12 @@ class ProductTemplate(models.Model): force_min_qty = fields.Boolean(string="Force minimum quantity?") by_company = fields.Boolean(string="Can be subscribed by companies?") by_individual = fields.Boolean(string="Can be subscribed by individuals?") - mail_template = fields.Many2one("mail.template", string="Mail template") + mail_template = fields.Many2one( + comodel_name="mail.template", + string="Certificate email template", + domain=[("model", "=", "res.partner"), ("is_cooperator_template", "=", True)], + help="If left empty, the default global mail template will be used.", + ) def get_web_share_products(self, is_company): if is_company is True: