health
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Health] Record Rules


From: Khurram Shahzad
Subject: Re: [Health] Record Rules
Date: Tue, 31 May 2016 09:55:56 +0500

Dear Cedric,

Thanks for the details.

I have created the following domain rule

 [["healthprof.name.internal_user.id", "=", [Eval("user.id",-1)]]]

but it is failing. The problem is with [Eval("user.id",-1)]. If I replace it with a constant it works fine.

Can you help me out?

On Mon, May 30, 2016 at 11:53 AM, Cédric Krier <address@hidden> wrote:
On 2016-05-30 09:01, Khurram Shahzad wrote:
> Dear Cedric,
>
> Thanks a lot. I worked like a magic.
>
> Can I further bother you by asking how can I refine this rule so that
> instead of hard-coding the id of the health professional, it picks the id
> of currently logged in user, finds the corresponding Party and then the
> Health Professional for the condition?

You can use the PYSON.Eval [1] in the _expression_. You will have by
default access to the current 'user' object.
Don't forget that the Eval statement must also by jsonified.


[1] http://doc.tryton.org/4.0/trytond/doc/ref/pyson.html#trytond.pyson.Eval

--
Cédric Krier - B2CK SPRL
Email/Jabber: address@hidden
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/




--
 
Regards,
Khurram.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]