Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3873 Zobrazení

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
Zrušit

i seems view is not correctly copy and paste here.

Nejlepší odpověď

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
Zrušit

Code :-

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

Related Posts Odpovědi Zobrazení Aktivita
1
pro 23
2337
2
srp 23
2107
1
pro 23
3706
1
čvc 23
2682
0
kvě 23
2491