What is the significance of adding the decorator @api.model over a cron job function. I have seen source code/oca modules using & skipping as well. How does it affect ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
When used with a cron job function, the @api.model decorator signifies that the method doesn't require record-level access and operates at the model level. This means that the method will not have access to individual records or their fields, but it can perform actions that relate to the model as a whole. Cron jobs typically perform periodic tasks or automated actions on data, and using @api.model allows the method to work efficiently without unnecessary record-level operations.
On the other hand, the @api.multi decorator (which you mentioned as skipping) is used for methods that operate at the record level and have access to individual records and their fields. These methods are designed to perform actions on specific records or work with record-related data.
To summarize, using @api.model decorator on a cron job function indicates that the method operates at the model level and doesn't require access to individual records. It helps optimize performance by skipping unnecessary record-level operations.
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
1
Jul 23
|
1599 | ||
|
1
Mar 17
|
7849 | ||
|
2
Agu 25
|
2396 | ||
|
1
Jul 25
|
902 | ||
|
1
Agu 25
|
1151 |