跳至內容
選單
此問題已被標幟
1 回覆
2869 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
2月 23
7085
2
12月 21
5861
1
4月 25
4744
0
8月 19
2854
1
10月 22
2917