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

Hi,

  Am working on odoov11 , i created a custom field x_difference which can calculate the difference between two fields open_meter_reading and close_meter_reading, i tried the following code in the compute field while creating the field

​x_difference = close_meter_reading - open_meter_reading​

but its not working, can anyone say the proper codes to use them to compute the difference?

if possible give the detail structure of the field that which datatype to used,what we have to write in related field, dependencies, and compute...

Thank you

อวตาร
ละทิ้ง

Have you added the code in field definition ? If yes than update the code and make on compute method where add the code which is there in answer section.

คำตอบที่ดีที่สุด

Hi,  

try this,

     self.x_difference = self.close_meter_reading - self.open_meter_reading​    

Thanks

Aswini - iWesabe




อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Compute field difference of dates แก้ไขแล้ว
2
ก.พ. 18
8310
0
ธ.ค. 23
1321
1
ก.ค. 22
2345
compute issue แก้ไขแล้ว
1
พ.ค. 21
3781
2
พ.ค. 25
896