you can create the function def in the specified class (def) which does changes you want, this in the python file, and for the action in the view call the function with the on_change attribute :
example :
sale_view line 107 :
field name="partner_id" on_change="onchange_partner_id(partner_id)"
call function in sale.py line 311 :
def onchange_partner_id(self, cr, uid, ids, part): .....
a little description in french for object and view :
http://myopenerp.blogspot.com/2009/12/les-objets-en-details.html