Views in OpenErp:- Two type of views in openerp
1- From Views
2- Tree Views
1- From Views:- In OpenErp Form Views follow many point like as
By default, each field is preceded by a label, with its name.
Fields are placed in screen right to left and top to bottom.
A view field can use several columns.
Example:-
<record id="view_invoice_penalty_form" model="ir.ui.view">
<field name="name">penalty.form</field>
<field name="model">add.penalty</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Penalty" >
<field name="date"/>
<field name="test"/>
</form>
</field>
</record>
2- Tree Views:- In OpenErp Tree Views are used when we work in list mode on the screen .
Example:-
<record id="view_invoice_penalty_form" model="ir.ui.view">
<field name="name">penalty.form</field>
<field name="model">add.penalty</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Penalty" >
<<field name="date"/>
<field name="test"/>
</form>
</field>
</record>
onChange method:- In OpenErp On change methods can be executed during the creation of a row, long before it is effectively saved into the database.
Onchange method look like as:
* .xml:- in xml file
<field name="name" on_change="name_change(name, address, city)"/>
* .py:- in py file</br>
def name_change(self, cr, uid, ids, name, address, city, context=None):
...
return {
'value': {
'address': ...
'city': ...
}
}
0 Comment(s)