attrs attribute on field, group, page, button tag

The new attrs attribute can be used to dynamically change other attributes of view components based on the value of other fields. It's somewhat similar to states attribute, but it will executed at client side only.
<form string="Some Form">
<notebook>
<page string="Main" attrs="{'': [('state','=','done')]}">
<field name="name" attrs="{'required': [('state','=','draft')],
'readonly': [('state','=','open')]}"/>
<field name="active"/>
<field name="state"/>
<group attrs="{'invisible': [('active', '=',0),('state','=','draft')]}">
some code
</group>
</page>
</notebook>
</form>
Readonly/Required attributes works on field tag visibility is supported on buttons, groups and pages to maintain form layout in OpenERP GTK/Web Client. Readonly/Required attributes will be supported for simple widgets only and not complex ones.

Comments

Unknown said…
Is there any way to manage 4-5 pages using attrs
like i have 4-5 pages every page containg 5-6 fields it's working for two pages but when i was creating 3 or more pages that time it's output is all pages at a time but i want open one page at one time
please help husen
Husen Daudi said…
Yes Its possible.
You can see the example of server action in OpenERP.
Based on selection type of action it is activating and deactivating pages.

Popular posts from this blog

OpenERP Installation Guide

change_default attribute