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

Im trying to calculate total volume of order line in one field  using odoo studio

1 I activate mode dev 

2 I Added field

3 Idid this code python 

for record in self:

record['x_studio_float_field_21r_1h8gqq14n'] = sum([record.line.x_studio_volume for line in record.x_studio_volume])

  but it didnt work

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,


It looks like you're trying to calculate the total volume of order lines and display it in a field using Odoo Studio. However, there seems to be a mistake in your Python code. Here's the corrected code:


for record in self:

    record['x_studio_float_field_21r_1h8gqq14n'] = sum(line.x_studio_volume for line in record.order_line)


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.พ. 23
7181
2
ธ.ค. 21
5997
Odoo studio icon is disabled แก้ไขแล้ว
1
เม.ย. 25
4870
0
ส.ค. 19
2973
1
ต.ค. 22
3032