You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
556 B

  1. You can create crons as usual via the admin interface or via code.
  2. The important thing, in both case, is to set `oneshot` flag as true.
  3. **Developer shortcut**
  4. You can easily create a oneshot cron like this:
  5. .. code-block:: python
  6. cron = self.env['ir.cron'].schedule_oneshot(
  7. 'res.partner', method='my_cron_method')
  8. If you need to customize other parameters you can pass them as keyword args:
  9. .. code-block:: python
  10. my_values = {...}
  11. cron = self.env['ir.cron'].schedule_oneshot(
  12. 'res.partner', method='my_cron_method', **my_values)