When I am in a task, if I change the stage of this task, a log is generated in the journal at the bottom on the task page like this :

http://reho.st/self/e17d8c40b5ef23a7918cd6b6b1af6af310f2b31c.png

Now, I would like to do the same thing using postgreSQL query :

I succeed to update the current stage of the task (in table project_task, then I insert a line in the table project_task_history to save the action of "stage changed", but when I refresh the page, the stage change is not saved in the journal ar the bottom of the task page ...

Do I miss something so that the task change is inserted in this journal ?

I would like to do this, so that I can generate a report based on the database later. I will need to calculate duration between two stages, so I need to log these stage-changes. Of course I can let the users of the project do it themselves with their mouse/keyboard using the UI, but it'll be better for me to automatically change stage of tasks once their deadline_date is over.

Also, sometimes we will have a lot of tasks to stage-change, so it would be great if I can do it automatically. Actually I can do it, but my problem is that no log is generated to say "previous stage => next stage", and I need a date to create a report in the future.

when you do it in sql, you bybass the write function of odoo which do the job...

You can do it in sql, with a message post, and reimplementing the logic of tracked field, but it is a really bad idea according to me...

One scheduled action that check a domain and change the stage is probably 3 lines of code... And workflow will be always ok... And you keep the logic in Odoo, you let Odoo do HIS job and you don't need to maintains 2 logics

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just
use the commenting tool. Please remember that you can always revise your answers
- no need to answer the same question twice. Also, please don't forget to vote
- it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines