Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4370 Vistas

I am creating a module to change the display of a form, I know how to hide a field from the form but not a whole group

What should I put to hide a whole group of a form?

Avatar
Descartar
Mejor respuesta

Hi,

To hide the whole group based on user, you may provide groups for the group tag. |
E.g
                    <group string="Configure your Fiscal Year" groups="account.group_account_user">
                        <field name="has_default_company" invisible="1" />
                        <field name="period"/>
                    </group>
You may also apply attrs same as field in group tag if required in your case. 
e.g
                                    <group attrs="{'readonly':[('state','=','valid')]}" string="Currency">
                                        <field name="currency_id" invisible="1"/>
                                        <field name="amount_currency" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                    </group>

 

Avatar
Descartar