Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3882 Vues

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
Ignorer

i seems view is not correctly copy and paste here.

Meilleure réponse

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
Ignorer

Code :-

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

Publications associées Réponses Vues Activité
1
déc. 23
2347
2
août 23
2119
1
déc. 23
3736
1
juil. 23
2699
0
mai 23
2507