Skip to Content
Menu
This question has been flagged
2053 Views
So i have this function and i'm getting error for some reason

def _product_inc_out_qty(self, cr, uid, ids, field_names=None, arg=False, context=None):
res = {}
for move in self.browse(cr, uid, ids, context=context):
res[move.id] = {
'incoming_qty': 0.0,
'outgoing_qty': 0.0,
}

res[move.id][
'incoming_qty'] = move.product_id.incoming_qty
res[move.id][
'outgoing_qty'] = move.product_id.outgoing_qty
return res

_columns = {
'incoming_qty': fields.function(_product_inc_out_qty, type='float',method=True,
digits_compute=dp.get_precision('Product Unit of Measure'),
string='Incoming'
),
'outgoing_qty': fields.function(_product_inc_out_qty, type='float',method=True,
digits_compute=dp.get_precision('Product Unit of Measure'),
string='Outgoing'
),
}


and i'm getting this error

value = float(value or 0.0) TypeError: float() argument must be a string or a number
Avatar
Discard
Related Posts Replies Views Activity
0
Oct 18
1695
1
Jun 24
296
1
Nov 22
2011
9
Mar 20
40581
2
Oct 18
2650