Hello Odoo's gurus,
In try to create a custom sum in the report of expenses. To make it simple, I made it with existing values: unit_amount in the expense report.
I have created a new value in Studio (float) in the expense report: x_studio_total_unit
In the depencies of the "x_studio_total_unit", I put:
x_studio_total_unit
For the calculation, I use a code grabbed and adapted from this forum...
sum = 0
for record in self:
for rec in record.expense_line:
if rec.unit_amopunt:
sum += rec.unit_amount
record['x_studio_total_unit'] = sum
Of course, it does not work... but its does not crash !
I am on Odoo 15, web version.
Thanks for your support.