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.

5

Change value of "use_contacts" in calendar if user belongs to a specific group (odoo 8.0)

By
dlsuarez
on 3/31/15, 7:56 AM 759 views

Hello,

I need to change the value of attribute "use_contacts" in calendar.event model through "xml_id" of user group:

The new code inherit from calendar.view_calendar_event_calendar, the code is:

<?xml version="1.0"?>
<openerp>
<data>
<!-- CRM Meeting Calendar -->
<record model="ir.ui.view" id="crm_view_calendar_event_calendar">
<field name="name">Meetings Calendar</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_calendar"/>
<field name="priority" eval="2"/>
<field name="use_contacts" eval="?????"/>
<field name="arch" type="xml">
<xpath expr="//calendar" position="replace">
<calendar string="Meetings" date_start="start" date_stop="stop" date_delay="duration" all_day="allday"
display="[name]" color="color_partner_id" attendee="partner_ids" avatar_model="res.partner"
use_contacts="[use_contacts]"
event_open_popup="%(calendar.view_calendar_event_form_popup)s">
<field name="name"/>
<field name="user_id"/>
<field name="color_partner_id"/>
<field name="partner_ids"/>
</calendar>
</xpath>
</field>
</record>
</data>
</openerp>
With this line code it doesn't works <field name="use_contacts" eval="?????"/> where ????? is replaced by [(3,ref('my_module.my_group_name'))]

I need to find another solution or alternative.

Thank you!

Use_contact, is a boolean to specify if you want to use your "favorite coworker" as filter or not. If you want filter on a specific field, you need to set it to false and use attendee="your field"... What is your my_module.my_group_name?

Jérémy Kersten (jke)
on 3/31/15, 5:05 PM

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

2 follower(s)

Stats

Asked: 3/31/15, 7:56 AM
Seen: 759 times
Last updated: 4/5/15, 5:00 PM