跳至内容
菜单
此问题已终结
1 回复
3884 查看

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
        

            
                
                
            

            
                
                
            
            
        
    


形象
丢弃

i seems view is not correctly copy and paste here.

最佳答案

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

形象
丢弃

Code :-

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

相关帖文 回复 查看 活动
1
12月 23
2348
2
8月 23
2121
1
12月 23
3738
1
7月 23
2705
0
5月 23
2508