Skip to Content
Menu
This question has been flagged
1 Reply
3239 Views

How to set up multiple views(all inherited from the same form view) for different user groups? For example, let's say that I have two user groups which are "customer", and "operator".
Both views are going to be inherited from a single form view. Following is the XML code for "customer" user group form view:

"

        repair.order.inherit.form.customer
        repair.order
        
        
        15
        

            
                
                
                
                
            
            
        
    

"

And when I try to add up a different inherited view for an another user group, there is a parsing error. This view is supposed to be used for user group "repairtest.group_repair_operator". What I'm trying to do is that when a user from "repairtest.group_repair_customer" user group wants to open a form, the form "view_form_repair_order_inherit_customer" should be opened. Same for the "Operator". Following is an example:


        repair.order.inherit.form.operator
        repair.order
        
        
        15
        

            
                
                
            

            
                
                
            
            
        
    


Avatar
Discard

i seems view is not correctly copy and paste here.

Best Answer

Hi @Blessings Everywhere

Hope you are doing Well.

When you are inheriting the views you will have to add the group_id like the below line


Please find code in comment. 


Now, when the user with that particular group opens the view the changes specified in the inherited view will take effect and for users without the specified group it will behave like it does not exist (No changes to view from the inherited file with group).


I hope it will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

Code :-

<field name="groups_id" eval="[(4,ref('module_name.group_name'))]"/>

Related Posts Replies Views Activity
1
Dec 23
999
2
Aug 23
932
1
Dec 23
2076
1
Jul 23
1521
0
May 23
1284