Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3754 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
4
juin 25
3053
0
mars 15
4509
1
mars 15
9883
0
mars 24
1131
1
nov. 22
3310