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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- 회계
- 재고 관리
- PoS
- 프로젝트
- MRP
신고된 질문입니다
3265
화면
| 관련 게시물 | 답글 | 화면 | 활동 | |
|---|---|---|---|---|
|
|
0
10월 18
|
2526 | ||
|
|
1
6월 24
|
1989 | ||
|
|
1
11월 22
|
3833 | ||
|
Expected singleton
해결 완료
|
|
9
3월 20
|
43118 | |
|
|
2
10월 18
|
4880 |
I'm not sure, but maybe it can help you
https://stackoverflow.com/questions/30531766/float-must-be-a-string-or-a-number