Community mailing list archives

community@mail.odoo.com

Re: Many2one field filter using child_of user login

by
Andre Kurniawan
- 09/06/2015 22:40:22

Hello Togar,

Sorry for the late reply. I followed your suggestion of having relation to res.users in res.users model named parent_id, but I still get the same error with this domain: [('id', '=', user.id)] on my own model.

Is there any other solution? I just want to limit the res.users relation field in my model to child_of the current user login.

On 09/04/2015 04:15 PM, Togar Hutabarat wrote:
<blockquote cite="mid:CAD=nRr5ba_3pk_OPbOOGZF4Em1vF20FFFhmoRJ8Amyt-gv4jFg@mail.gmail.com" type="cite">
You need to add one additional many2one field on res.users, referenced to res.users itself, and the field name must be 'parent_id'. I guess that is the requirement of using child_of things.

On Fri, Sep 4, 2015 at 2:08 PM, vak0160 <vak0160.work@gmail.com> wrote:

Hello Community,


I have  a Many2one field
referenced to model res.users,
and I want this field filtered using child_of current
user login.


I already tried with
[('id', 'child_of',
user.id)]
but it gives me an error:


Error: NameError: name 'user' is not defined.



Is there any way to accomplish this?




-- 
Regards,
Andre



_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe





_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe






-- 
Regards,
Andre