Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3975 มุมมอง


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.


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Compute the field only in the form view แก้ไขแล้ว
1
ก.ค. 17
5995
2
มี.ค. 15
5603
0
มี.ค. 15
4021
1
มี.ค. 15
9865
0
มี.ค. 15
4120