Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I'm trying to create a geneic filter (for all users) to allow users to see the meetings in the calendar where they are included as attendees. I'm trying something like this:
but when using the filter I receive the error: Uncaught TypeError: Cannot read property 'length' of undefined http ://sv-openerp-test/web/static/src/js/views.js:791
Any ideas on how to do this? Thanks in advance!
NOTES: As far as I see the relationship between the meeting and the partners is "partner_ids" (instead of "attendee_ids"). The existing filter "My Meetings" shows the ones where I'm the creator of the meeting, but does not show the ones where I'm invited.
View Name: CRM - Meetings Search
View Type: Search
External ID: base_calendar.view_crm_meeting_search
<search string="Search Meetings"> <field name="name" string="Meeting" filter_domain="[('name','ilike',self)]"/> <field name="partner_ids"/> <field name="categ_ids"/> <field name="user_id"/> <separator/> <filter string="My Meetings" help="My Meetings" domain="[('user_id','=',uid)]"/> <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/> </search>
Domain operator 'in' expects a list as second argument, so please try:
[['partner_ids', 'in', [user.partner_id.id]]]
If you want the meeting to be visible to a whole company aswell try:
['|', ['partner_ids.child_ids', 'in', [user.partner_id.id]], ['partner_ids', 'in', [user.partner_id.id]]]
@ shashank verma and Jack:
Your suggestion to use record rules will indeed filter the meetings, but it's not possible for a user to deactivate this filter.
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 platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/8/14, 2:16 PM|
|Seen: 1887 times|
|Last updated: 3/16/15, 8:10 AM|