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

When an employee edits his/her information I want to restrict certain fields not to edit by employee (but can be editable by ADMIN).

形象
丢弃
最佳答案

Hi,

You could use the "read" and "write" attributes on field definition, like this one:

    _columns = {
        'credit_limit': fields.float(string='Credit Limit',
                                     read=['base.group_sale_salesman'],
                                     write=['base.group_sale_manager']),

This will create a field named credit_limit that will be readable by users belonging to base.group_sale_salesman and writable only by base.group_sale_manager users...

形象
丢弃
编写者

Hi Mario, Thanks for the reply. It helped me a lot.

最佳答案

You can apply group on that field.admin exist to that group not user.

like groups="base.group_no_one"

形象
丢弃
相关帖文 回复 查看 活动
4
8月 23
12166
0
11月 16
1353
1
3月 15
4812
2
3月 15
4739
4
10月 20
6685