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
- Buchhaltung
- Lager
- PoS
- Projekte
- MRP
Diese Frage wurde gekennzeichnet
3270
Ansichten
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
Registrieren| Verknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
|---|---|---|---|---|
|
|
0
Okt. 18
|
2527 | ||
|
|
1
Juni 24
|
1991 | ||
|
|
1
Nov. 22
|
3835 | ||
|
Expected singleton
Gelöst
|
|
9
März 20
|
43120 | |
|
|
2
Okt. 18
|
4882 |
I'm not sure, but maybe it can help you
https://stackoverflow.com/questions/30531766/float-must-be-a-string-or-a-number