Community mailing list archives

community@mail.odoo.com

Re: how to disable record rule in ODOO

by
nikideveloper100
- 12/30/2015 22:46:49
As i disable this global rule by this code 


        <record id="crm.calendar_event_global" model="ir.rule">
            <field name="name">Hide Private Meetings</field>
            <field eval="0" name="active" />
            <field ref="calendar.model_calendar_event" name="model_id"/>
        </record>


after that I want to apply new rule that will not be affected to my object calendar.event

        <record id="calendar_rule_user" model="ir.rule">
            <field name="name">Meeting User</field>
            <field ref="calendar.model_calendar_event" name="model_id"/>
            <field name="domain_force">[('user_id','=',user.id)]</field>
            <field name="groups" eval="[(4, ref('group_calendar_user'))]"/>
        </record>
         
        <record id="calendar_rule_manager" model="ir.rule">
            <field name="name">Meeting All Record</field>
            <field ref="calendar.model_calendar_event" name="model_id"/>
            <field name="domain_force">[(1,'=',1)]</field>
            <field name="groups" eval="[(4, ref('group_calendar_manager'))]"/>
        </record>
 

On Thu, Dec 31, 2015 at 12:39 AM, Jay Vora (SerpentCS) <vora.jay@serpentcs.com> wrote:
Nikul,

As a better practice, it's good to deactivate the rule by overriding the xml record and setting active=False.

Thanks,
Regards,
Jay Vora.
Serpent Consulting Services Pvt Ltd.
M : 091-9879354457


-------- Original Message --------
From:nikul patel <nikideveloper100@gmail.com>
Sent:Wed, 30 Dec 2015 23:42:00 +0530
To:Community <community@mail.odoo.com>
Subject:how to disable record rule in ODOO

hello every one , can any one help me about record rule.


How you can remove record that is already define in base module


  <record id="calendar_event_global" model="ir.rule">
        <field name="name">Hide Private Meetings</field>
        <field ref="model_calendar_event" name="model_id"/>
        <field eval="1" name="global"/>
        <field name="domain_force">['|',('user_id','=',user.id),('show_as','=','busy')]</field>
    </record>

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe