Skip to Content
Menú
This question has been flagged
1 Respondre
3530 Vistes

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
Descartar
Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
4
de juny 25
2269
0
de març 15
4257
1
de març 15
9504
0
de febr. 24
929
1
de nov. 22
3032