Field.function / method not automatically updating field
i have a function which currently works when a user pick and item from a dropdown menu it changes the value of another field.
however the other field only changes when i click save how can i make this that as soon as i change the value of the dropdown field the , other fields value changes without having to click save.
.py file
class account_analytic_account(osv.osv):
_name = "account.analytic.account"
_inherit = "account.analytic.account"
def get_rental(self,cr,uid,ids,context,table1,obj2):
x={}
obj1 = self.pool.get('mm.control')
for record in self.browse(cr, uid , ids):
table1 = obj1.search(cr,uid,[('company','=',record.invcompany_id.id)])
obj2=obj1.browse(cr,uid,table1[0])
x[record.id]=obj2.rental_split
print table1
print record.invcompany_id
print obj2.rental_split
return x
_columns = {
'invcompany_id': fields.many2one('res.company', 'Invoicing Company ' , domain="[('company_type', '=', 'Property Company')]" ,required=True, select=1),
'rental_split': fields.function(get_rental , method=True ,string= 'Rent', store=False, type="integer", help="Rent split of total rent amount *25"),
}
.xml
<group>
<field name="rental_split"/>
<field name="invcompany_id"/>
</group>
Any ideas to make the field automatically update without saving