i have odoo 12
i am creating a custom module and have a field 'assigned_to'
*.py
assigned_to = fields.Many2one('res.users', string='Assigned To')
i need to filter assigned_user with logged user
*.xml
<record id="bug_search_view" model="ir.ui.view">
<field name="name">test.Search.View</field>
<field name="model">test.test</field>
<field name="arch" type="xml">
<search string="Search Bugs">
<field name="project_name"
filter_domain="['|',('title_name', 'ilike',self), ('project_name', 'ilike', self)]"/>
<field name="title_name"/>
<field name="project_name"/>
<separator/>
00
<filter string="Assigned to Me" name="assigned_to" domain="[('user_id', '=', uid)]" help="assigned to me"/>
</search>
</field>
</record>
I got an error
raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf))) ValueError: Invalid field 'user_id' in leaf "<osv.ExtendedLeaf: ('user_id', '=', 2) on bugg__tracker_bugg__tracker (ctx: )>"please help me to fix this issue.....
thanks, it is working
On Tue, Oct 15, 2019 at 1:44 PM Niyas Raphy <niyasraphyk@gmail.com> wrote: