Odoo Help

2

Is it possible to have different task stages visible for some groups?

By
Mathews Jose
on 8/24/15, 3:28 AM 603 views

Hi,

I need to acess different task stages for different users group.
I need to hide some task stages for some groups.

Thank you.

2

Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
904
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.

https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile

tibrahim@2p.com.sa

Tarek Mohamed Ibrahim
On 8/25/15, 4:08 AM

Yes, it is possible using groups and rules.

To prove that I applied the following code on my budget module 'budget_expense' . I needed some users to see only the 'draft' budget, others to see the 'confirm' ones, I wrote the following groups and rules.

this is the category: 

<record model="ir.module.category" id="module_category_special">
<field name="name">Budget Miscelenious</field>
<field name="description">Budget Miscelenious</field>
        <field name="sequence">26</field>
</record>

following are two groups

<record id="group_test01" model="res.groups">
<field name="name">Show only 'Draft'</field>
        <field name="category_id" ref="budget_expense.module_category_special"/>
field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
<record id="group_test02" model="res.groups">
<field name="name">Show only 'confirmed'</field>
<field name="category_id" ref="budget_expense.module_category_special"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

following are two rules, a rule for each group

<record model="ir.rule" id="apply_rule_on_draft">
<field name="name">test01</field>
<field name="model_id" ref="budget_expense.model_budget_expense"/>
<field name="domain_force">
[('state','=','draft')]
</field>
<field name="groups" eval="[(4, ref('budget_expense.group_test01'))]"/> <field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
<record model="ir.rule" id="apply_rule_on_confirm">
<field name="name">test02</field>
<field name="model_id" ref="budget_expense.model_budget_expense"/>
<field name="domain_force">
[('state','=','confirm')]
</field>
<field name="groups" eval="[(4, ref('budget_expense.group_test02'))]"/> <field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>

If you need a user to see only the 'draft' status, assign him to the group 'group_test01'

If you need a user to see only the 'confirm' status, assign him to the group 'group_test02'

if you need him to see both states, assign him to both groups

I explained the idea on my code that I tested it and already got result from it, you can imitate exactly the same idea on your case

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

Question tools

3 follower(s)

Stats

Asked: 8/24/15, 3:28 AM
Seen: 603 times
Last updated: 8/26/15, 5:21 AM