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.

23 lines
684 B

  1. - I create a user that will run the job.
  2. - !record {model: res.users, id: worker_user, view: False}:
  3. company_id: base.main_company
  4. name: worker
  5. login: worker
  6. password: worker
  7. email: worker@example.com
  8. - Create a cron job to check the UID
  9. - !record {model: ir.cron, id: check_uid_job}:
  10. name: Check UID
  11. active: True
  12. user_id: worker_user
  13. interval_number: 1
  14. interval_type: days
  15. numbercall: -1
  16. doall: False
  17. model: ir.cron
  18. function: _current_uid
  19. - I execute the cron job manually to check its running UID
  20. - !python {model: ir.cron, id: check_uid_job}: |
  21. assert self.run_manually()[0] == self.user_id.id, "Wrong UID in cron job"