Browse Source

Don't pollute other models just for testing this one.

--HG--
extra : amend_source : d3da15fc7b
pull/80/head
Jairo Llopis 10 years ago
parent
commit
3ba101c454
  1. 11
      scheduler_error_mailer/ir_cron.py
  2. 5
      scheduler_error_mailer/ir_cron_demo.xml

11
scheduler_error_mailer/ir_cron.py

@ -67,10 +67,9 @@ class ir_cron(orm.Model):
return res
class res_users(orm.Model):
_inherit = 'res.users'
def test_scheduler_failure(self, cr, uid, context=None):
def _test_scheduler_failure(self, cr, uid, context=None):
"""This function is used to test and debug this module"""
raise orm.except_orm(_('Error :'), _("Task failure with UID = %d." % uid))
raise orm.except_orm(
_('Error :'),
_("Task failure with UID = %d.") % uid)

5
scheduler_error_mailer/ir_cron_demo.xml

@ -18,9 +18,8 @@
<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" eval="'res.users'"/>
<field name="function" eval="'test_scheduler_failure'" />
<field name="args" eval="'()'"/>
<field name="model">ir.cron</field>
<field name="function">_test_scheduler_failure</field>
</record>
</data>

Loading…
Cancel
Save