class model_model(osv.osv):
_name = "model.model"
def multi_a_b(self, cr, uid, ids, name, arg, context=None):
res = {}
for record in self.browse(cr, uid, ids,context):
res[record.id] = record.quantity * record.value
return res
_columns = {
'product' : fields.many2one('product.product','Product',required=True),
'quantity' : fields.integer('Quantity',size = 16,required = True,translate = True),
'value' : fields.float('Value',size = 16,required = True,translate = True),
'amount' : fields.function(multi_a_b, string='Amount', type='float'),
}
model_model()
i want to multiple quantity*value get the answer in amount field. But i didnt get any output.