Send automatic mail when record was updated two hours ago

(Nicolás López Solano) #1

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

(Cédric Krier) #2

Could you explain what is wrong?

(Nicolás López Solano) #3

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

(Cédric Krier) #4

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

(Nicolás López Solano) #5

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

(Cédric Krier) #6

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