跳至內容
選單
此問題已被標幟
1 回覆
3535 瀏覽次數

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.

頭像
捨棄
最佳答案

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')

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
4
6月 25
2273
0
3月 15
4269
1
3月 15
9505
0
2月 24
933
1
11月 22
3037