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

[8] How to inherit or delete rule

By
HateCamel
on 7/1/15, 4:47 PM 958 views

I am trying to inherit rule in sale order and change the domain, but nothing is happening, even though I am getting no error messages.


<record id="sale.sale_order_see_all" model="ir.rule">
<field name="name">All Orders</field>
<field ref="model_sale_order" name="model_id"/>
<field name="domain_force">[('classified','=',False)]</field>
<field name="groups" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
</record>
1

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 7/2/15, 3:42 AM

Delete with xml record like:

<delete model="ir.rule" id="sale.sale_order_see_all"/>

You can put new rule definition after this one in same xml...

To Modify:
In groups field you copied eval value: [4,... from original xml file, this works only the firs time you add record...
in order to modify, the groups to apply you should use folowing synthax:

<field name="groups" eval="[(6, 0, [ref('base.group_sale_salesman_all_leads'), ref('optional_other_group_id')])]"/>

(replace the values in m2m relation with new ones in order to apply new rules) 

Hope it helps :)

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 7/2/15, 6:07 AM

Try this:


<record id="sale.sale_order_see_all" model="ir.rule">

  <field name="domain_force">Your new domain</field> 

</record>

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: 7/1/15, 4:47 PM
Seen: 958 times
Last updated: 7/2/15, 6:07 AM