Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM
|
e-Commerce
|
Accounting
|
Inventory
|
PoS
|
Project management
|
MRP
|
etc.
OpenERP Cron with field increment?
How can I create a cron job that is executed every end of the year, and all it does is increment a field by 1. That's all
Thanks.
You can do this by creating a scheduler, go to Settings > Technical > Scheduler > Scheduled Actions
Check the existing scheduled actions to get an idea how it works.
To increment either do it by code with a read/increment/write operation, or use a sequence.
I did that, but how do I do the increment? Could you please give me an example code that shows you getting a value from a column and incrementing it.
Get the value, increment it with python and then save it again.
You can find the functions to read and write in this page https://doc.openerp.com/v6.1/developer/03_modules_2/
A good example is the currency_rate_update module, which runs the "run_currency_update" function once a day. Download that module and look at the code. You'll have to 1. write a python module 2. install your module 3. create a new Scheduled Action referencing your new module and the Increment function (method) you want to run. You should be 90% of the way there by referencing the currency_rate_update module (I think you really only need to reference the class Currency_rate_update, you can probably ignore the rest)
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 10/6/13, 4:55 PM |
Seen: 1874 times |
Last updated: 3/16/15, 8:10 AM |