コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3585 ビュー

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
2357
0
3月 15
4300
1
3月 15
9546
0
2月 24
962
1
11月 22
3074