Skip to Content
Menu
This question has been flagged
3480 Views

 in create method i call function . if in case job is failed then how to resend it.

def create(self, cr, uid, ids, context=None):

      res = super(project, self).create(cr, uid, ids, context=context)

      time_now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")

       nextcall = parser.parse(time_now) + timedelta(seconds=10)

       self.pool.get('ir.cron').create(cr, uid, {

       'name': 'This is Cron job',

      'user_id': uid,

      'model': 'project.project',

       'function': '_compute_project',

      'nextcall': nextcall,

      'args': repr([res])

})

return res

Avatar
Discard
Related Posts Replies Views Activity
2
Apr 23
1412
0
Mar 15
4512
1
Mar 15
4643
8
May 23
21950
0
May 21
2371