Send automatic mail when record was updated two hours ago

Hello, we need to send an automatic mail two hours later than a record update.

We use notification_email and “on_time” trigger but have some problems with pyson expression. We try to use this pyson expression:

Greater(Get(Eval(u’self’, {}), u’write_date’, u’’), DateTime(delta_hours=2))

but it doesn’t work because the expression is wrong

What is the best way to do that?

Thanks in advance

1 Like

Could you explain what is wrong?

When I write this expression at trigger form it appear as wrong. I think Greater function don’t allow datetime parameters

No it is because the default value for Get (which is used to define the type) is not a datetime.

I tried to write it with default value for Get and:
Greater(Get(Eval(u’self’, {}), u’write_date’, DateTime(1)), DateTime(delta_hours=2)) don’t work but
Equal(Get(Eval(u’self’, {}), u’write_date’, DateTime(1)), DateTime(delta_hours=2)) was ok

Indeed you are right Date, DateTime and Decimal are not yet supported by PYSON: Issue 4879: Suport Date, DateTime and Decimal fields in Greater/Less Pyson statement - Tryton issue tracker