I have a float field total_qty.
I want to change another 4 quantities when this field changes.
So i create an on_change function as follows..
in .xml,
<field name="total_qty" on_change="onchange_total_qty(total_qty)"/>
in .py,
def onchange_total_qty(self,cr,uid,ids,total_qty,context=None):
vals = {'ratio_codes': '','r38ids': '','r40ids': '','r42ids': '','r44ids': ''}
if total_qty:
sample2=self.pool.get('ratio').browse(cr, uid, total_qty, context=None)
vals['ratio_codes'] = sample2.ratio_code
vals['r38ids'] = sample2.r38 * total_qty
vals['r40ids'] = sample2.r40 * total_qty
vals['r42ids'] = sample2.r42 * total_qty
vals['r44ids'] = sample2.r44 * total_qty
return {'value' : vals }
But when i execute the following error occured!!
TypeError: 'float' object is not iterable
What should be the mistake?