Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

[Solved] How do I create a filter against user id - Odoo 8

By
Siobhan
on 6/5/15, 3:30 AM 1,450 views

Hello

I have a module created for helpdesk tickets. I have a menu called public tickets that will show all tickets created regardless of user. What I would like is a second menu called "my tickets" which just shows ticket that I have created and/or responsible for.

I started with a menu item:

<menuitem id="helpdesk_mytickets_menu" name="My Tickets" parent="helpdesk_menu" action="helpdesk_mytickets_action"/>

and I created a view dependant on Public Ticket. Both are showing same results so I tried to add a filter to My tickets view:

<field name="responsible_id" domain="[('responsible_id', '=', res_users_id"/>

This is not working

Not sure what I need to do here. Is it best to create a new module and inherit? (tried but menu didn't appear) or

can I just add a filter to current module and get it to show up in "my tickets" menu?

1
Turkesh Patel
On 6/5/15, 8:20 AM

You can set domain in your action of this menu My Tickets.

in helpdesk_mytickets_action action you can set domain

<field name="domain">[('responsible_id','=',uid)]</field>

NOTE: responsible_id should be m2o with res.users


Brilliant.. thank you!!

Siobhan
on 6/8/15, 1:54 AM

You welcome

Turkesh Patel
on 6/8/15, 4:30 AM
0

Hi Siobhan,

Is your module publicly available for sharing?

0
ankita
On 6/5/15, 8:50 AM

Hello Siobhan

Please try this

<field name="domain">['|',('responsible_id.user_id','=',uid)]</field>

hope this work for you.

This didn't work but thank you for your response Ankita

Siobhan
on 6/8/15, 1:53 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/5/15, 3:30 AM
Seen: 1450 times
Last updated: 8/21/15, 4:33 AM