Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3834 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
cze 25
3452
0
mar 15
4657
1
mar 15
10106
0
lut 24
1271
1
lis 22
3501