Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2175 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
úno 23
6615
2
pro 21
5391
1
dub 25
4002
0
srp 19
2521
1
říj 22
2449