Skip to Content
Menu
This question has been flagged
2 Replies
1733 Views

Hello


I am using V14 I have many computed fields in my database and all have a dependency of a boolean field I created called "calculate" is there a way to have this field toggle daily?  I have tried to create a field that is just equal to today, in order to get this to update I have unmarked the stored button, and then make the date field a dependency of my boolean field but it does not seem to work.  

Avatar
Discard
Best Answer

Hey,

Create a method in your class that updates the value like this


def update_boolean(self):

    for record in self:

        record.boolean_field = not record.boolean_field


then create a scheduled action and add a schedule action like this


and this should work.


PS: Toggling a boolean every day isn't an optimized approach.

Regards,

Divyansh


Avatar
Discard
Best Answer

Hai,

        You can use a scheduled action to perform this action. To know more about scheduled actions you can refer  https://www.cybrosys.com/blog/automated-action-in-odoo in the mentioned blog you will find a field "nextcall".

<field name="nextcall" >2016-12-31 23:59:59</field>

 Using this field you can plan next execution date for this job, Hope this helps.

Thankyou.

Avatar
Discard