I'm trying to create two calculated fields and am using this code as an example for the recurring margin, but it isn't working. Can anyone help me out?
For record in self:
Total_recurrente = 0
For line in record.order_line:
If line.product_id and line.product_id.recurring_plan_id:
Total_recurrente += line.margin
Record[‘x_studio_margen_recurrente’]= total_recurrente
"isn't working" - can you expand on what this means? Do you get an error? Incorrect calculation? No calculation?
This may increase the chances of a good answer.
the field value always shows as 0