diff --git a/addons/rating_project/models/project.py b/addons/rating_project/models/project.py index 49f1a4414d2..69fb394e93a 100644 --- a/addons/rating_project/models/project.py +++ b/addons/rating_project/models/project.py @@ -7,10 +7,13 @@ class ProjectTaskType(models.Model): _inherit = 'project.task.type' + def _default_domain_rating_template_id(self): + return [('model', '=', 'project.task')] + rating_template_id = fields.Many2one( 'mail.template', string='Rating Email Template', - domain=[('model', '=', 'project.task')], + domain=lambda self: self._default_domain_rating_template_id(), help="Select an email template. An email will be sent to the customer when the task reach this step.") auto_validation_kanban_state = fields.Boolean('Automatic kanban status', default=False, help="Automatically modify the kanban state when the customer reply to the feedback for this stage.\n" diff --git a/addons/rating_project_issue/models/project_issue.py b/addons/rating_project_issue/models/project_issue.py index 32b5c149df7..15c29839449 100644 --- a/addons/rating_project_issue/models/project_issue.py +++ b/addons/rating_project_issue/models/project_issue.py @@ -25,6 +25,16 @@ class ProjectIssue(models.Model): return super(ProjectIssue, self).rating_apply(rate, token=token, feedback=feedback, subtype="rating_project_issue.mt_issue_rating") + +class Stage(models.Model): + + _inherit = ['project.task.type'] + + def _default_domain_rating_template_id(self): + domain = super(Stage, self)._default_domain_rating_template_id() + return ['|'] + domain + [('model', '=', 'project.issue')] + + class Project(models.Model): _inherit = "project.project"