I want to automate an action and here is the code that I'm using:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="ir_cron_scheduler_demo_action" model="ir.cron">
<field name="name">Demo scheduler</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">2</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field eval="'note.admin'" name="model"/>
<field eval="'process_demo_scheduler_queue'" name="function"/>
</record>
</data>
</openerp>
@api.model
def process_demo_scheduler_queue(self):
for note in self.env['note.admin']:
if datetime.strptime(note.date, DEFAULT_SERVER_DATETIME_FORMAT).date() == datetime.now().date():
note.write({'is_visible': True})
What I want to do is to set the value is_visible on True when the field note.date == current date
here is the log on server:
2016-05-25 01:20:17,658 3680 INFO test3 werkzeug: 127.0.0.1 - - [25/May/2016 01:20:17] "POST /web/dataset/call_kw/note.admin/message_get_subscription_data HTTP/1.1" 200 -
but it is not working!
