Odoo v15
I create a "Margin 2 [x_studio_margen_2]" field at "sale.order" that is supposed to be the sum of every field "Total Margin 2 [x_studio_total_margen_2" at "sale.order.line".
When I add one product, everything is ok, but the problem comes when I add a second product.
I though that it would work but it release an "Expected singleton" error
total = 0
for record in self:
total += record.order_line.x_studio_total_margen_2
record['x_studio_margen_2'] = tot
I've read another post with same error but not the same case and I haven't fix it.