Skip to content

Commit

Permalink
Merge pull request #57 from bealdav/8-email-tpl-field-fix
Browse files Browse the repository at this point in the history
scheduler_error_mailer - email template field name fix
  • Loading branch information
yvaucher committed Jan 5, 2015
2 parents 825a26d + 899fa11 commit 271e515
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scheduler_error_mailer/ir_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ class ir_cron(orm.Model):
_inherit = "ir.cron"

_columns = {
'email_template': fields.many2one(
'email_template_id': fields.many2one(
'email.template',
'Error E-mail Template',
oldname="email_template",
help="Select the email template that will be "
"sent when this scheduler fails."),
}
Expand All @@ -50,7 +51,7 @@ def _handle_callback_exception(self, cr, uid, model_name, method_name,

my_cron = self.browse(cr, uid, job_id)

if my_cron.email_template:
if my_cron.email_template_id:
# we put the job_exception in context to be able to print it inside
# the email template
context = {
Expand Down
2 changes: 1 addition & 1 deletion scheduler_error_mailer/ir_cron.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<field name="inherit_id" ref="base.ir_cron_view"/>
<field name="arch" type="xml">
<field name="doall" position="after">
<field name="email_template" />
<field name="email_template_id" />
</field>
</field>
</record>
Expand Down
2 changes: 1 addition & 1 deletion scheduler_error_mailer/ir_cron_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<field name="interval_type">hours</field>
<field name="numbercall">-1</field> <!-- don't limit the number of calls -->
<field name="doall" eval="True"/>
<field name="email_template" ref="scheduler_error_mailer"/>
<field name="model">ir.cron</field>
<field name="function">_test_scheduler_failure</field>
<field name="email_template_id" ref="scheduler_error_mailer"/>
</record>

</data>
Expand Down

0 comments on commit 271e515

Please sign in to comment.