Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3664 Tampilan

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.

Avatar
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
4
Jun 25
2686
0
Mar 15
4393
1
Mar 15
9718
0
Feb 24
1054
1
Nov 22
3200