Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3521 Lượt xem

Hi comunity

A question maybe easy, but sought to restrict the fields (in xml or py) with security permissions. Someone who can help or give guidance?? Thanks.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

you can use groups keywords/attribute in python as well as in xml.

some thing Like in xml [/account/account_invoice_view.xml]:

 <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
name="account_id" groups="account.group_account_user"/>


some thing Like in .py [/addons/account/partner.py]:

'total_invoiced': fields.function(_invoice_total, string="Total Invoiced",

                                    type='float',

                                    groups='account.group_account_invoice')

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 6 25
2259
0
thg 3 15
4250
1
thg 3 15
9504
0
thg 2 24
922
1
thg 11 22
3031