On 2017-08-23 16:02, Khurram Shahzad wrote:
> Hi all,
>
> I want to display the appointments of currently logged in user. For this I
> wrote following record in the view.xml:
>
> <field name="domain" eval="[('healthprof.name.internal_user.id', '=', Eval('
> user.id'))]" pyson="1"/>
You can not use dot notation inside Eval.
I guess you want to have the user id from the context so you must use:
Eval('context', {}).get('user')
On 2017-09-05 22:11, Khurram Shahzad wrote:
> On Tue, Sep 5, 2017 at 2:35 PM, Cédric Krier <cedric...@b2ck.com> wrote:
>
> > On 2017-08-23 16:02, Khurram Shahzad wrote:
> > > Hi all,
> > >
> > > I want to display the appointments of currently logged in user. For this
> > I
> > > wrote following record in the view.xml:
> > >
> > > <field name="domain" eval="[('healthprof.name.internal_user.id', '=',
> > Eval('
> > > user.id'))]" pyson="1"/>
> >
> > You can not use dot notation inside Eval.
> > I guess you want to have the user id from the context so you must use:
> >
> > Eval('context', {}).get('user')
> >
>
> I tried it as follows:
> <field name="domain" eval="[('doctor_id.name.internal_user.id', '=',
> Eval('context',{}).get('user'))]" pyson="1"/>
>
> But, it failed with following exception:
> Invalid input syntax for integer: "" at character 1406.
>
> When I checked query in the postgreSQL log, I found "d"."id" = '' where
> "d" is alias for res_user table.
Indeed the key is '_user' not 'user'.