Skip to Content
Menu
This question has been flagged
1 Atsakyti
3519 Rodiniai

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.

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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
4
birž. 25
2256
0
kov. 15
4250
1
kov. 15
9504
0
vas. 24
921
1
lapkr. 22
3031