diff options
| author | Thibault Delavallée <tde@openerp.com> | 2016-01-12 11:14:06 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2016-02-01 12:15:56 +0100 |
| commit | 0cf2ceca90fdcb59cdecea17ccd9aa40cdf575e0 (patch) | |
| tree | d93d3f5e2da6cbe55f170d2d6c0f53641f3287a0 /addons/project_issue/project_issue.py | |
| parent | 9b43a8c8f6b9e6cd8279503aeac9f63448d29388 (diff) | |
[IMP] project, issue: template on stages
Added a mail_template_field on project stage model (project.task.type). This
fields is used to automatically send an email when a task or issue comes in
this stage.
Recruitment code has been updated to use the mixin method.
Diffstat (limited to 'addons/project_issue/project_issue.py')
| -rw-r--r-- | addons/project_issue/project_issue.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 7e3698e9f05..45ed5b446fe 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -302,6 +302,15 @@ class project_issue(osv.Model): # Mail gateway # ------------------------------------------------------- + @api.multi + def _track_template(self, tracking): + res = super(project_issue, self)._track_template(tracking) + test_issue = self[0] + changes, dummy = tracking[test_issue.id] + if 'stage_id' in changes and test_issue.stage_id.mail_template_id: + res['stage_id'] = (test_issue.stage_id.mail_template_id, {'composition_mode': 'mass_mail'}) + return res + def _track_subtype(self, cr, uid, ids, init_values, context=None): record = self.browse(cr, uid, ids[0], context=context) if 'kanban_state' in init_values and record.kanban_state == 'blocked': |
