简体   繁体   中英

Access other field of currently logged user In domain in Action window Odoo13

I have a domain in window action. I want to filter the data by this domain, and I need to acccees another field of currently logged user some like this ( uid.branch_ids.ids ) and use this field in the domain. I don't know how to do it Here is my code:

<field name="domain">[('type', '=', 'out_invoice'),('invoice_line_ids.branch_id', 'in', uid.branch_ids.ids)]</field>

when I run this code gives me this error:

object has no attribute 'branch_ids'

But I have the branch_ids in my res.users model

The user record is not available in the evaluation context.

You can use the user id ( uid ) and the inverse field defined in branch model that refers to the res.user model to compare to branch user id to the current user id.

Example:

 ('invoice_line_ids.branch_id.user_id', '=', uid)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM