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

Hello friends, my question is regarding applications created in Studio, for example, where my internal user clients can only see their records and data, based on their "res.partner". Version 16.2 Enterprise.

形象
丢弃
编写者 最佳答案

hello dear
Thanks for your tip.
I tested the filter rule, but it doesn't seem to work. I must have done something wrong.
This error appears:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/saas-15.2/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/saas-15.2/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field x_teste.partner_id in leaf ('partner_id', '=', 106)


形象
丢弃
最佳答案

Hi,

For this you can write a record rule for the corresponding model for the particular user group with necessary domain, by this you can restrict the user to see only his own records.

Activate developer mode and from the record rules menu, give a name for rule, select your model, in the domain enter the following domain:

[('partner_id', '=', user.partner_id)] and select your group.


Above domain expect you to have a partner_id field in your model, if not change the field name in the domain accordingly.

Thanks

形象
丢弃
相关帖文 回复 查看 活动
2
2月 24
7349
1
1月 24
1469
1
8月 23
1710
6
11月 24
3036
2
10月 24
1121