orelevance = {'Medium 6': '0.6'}
s = orelevance.values()
a = float([x for x in s][0])
cost = 1000
print(a*cost)Basically what this does is it takes a dictionary, converts the value to a float and multiplies it by the cost.
In Odoo I have an item in the inventory that has a cost which i believe is the field standard_price,
and I want to take that cost and multiply it by a selection in a drop down list. Hence converting the dictionary into a float.
The result would then get stored in a new list_price field.
Can anyone help with this. I can explain it some more if my question isn't totally clear.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilitate
- Inventar
- PoS
- Project
- MRP
Această întrebare a fost marcată
3797
Vizualizări
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Înscrie-teRelated Posts | Răspunsuri | Vizualizări | Activitate | |
---|---|---|---|---|
|
1
iul. 17
|
5800 | ||
|
2
mar. 15
|
5467 | ||
|
0
mar. 15
|
3866 | ||
|
1
mar. 15
|
9627 | ||
|
0
mar. 15
|
3971 |