I am trying to use threads in Odoo 14 for the first time and I would like to ask for some basics and common pitfalls.
I found surprisingly little on this topic online. Even official docs basically say: don't do this unless you are 1000% sure you know what you are doing, but they don't provide any resources on how to learn it.
Key points I would like to learn:
- How to read, write, create and unlink records in a new thread?
- When to commit and when to rollback?
- What is cr.savepoint()?
My usecase: I have 2000 products for which I need to get the current price every day from 5 different vendor e-shops with HTTP requests. This process will be run from CRON and cannot be blocking, because it might take a long time to complete.
Any help would be appreciated. Even if you answer only part of my questions I would be glad.