Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
4222 Visualizações

 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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
abr. 23
2938
0
mar. 15
5659
1
mar. 15
5951
8
mai. 23
24629
0
mai. 21
3710