Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4235 Visualizzazioni

 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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
apr 23
2951
0
mar 15
5680
1
mar 15
5976
8
mag 23
24677
0
mag 21
3743