Skip to Content
Menu
This question has been flagged
1 Reply
527 Views

We are creating sales order for services that we deliver step by step, on a monthly basis.

Let's say we sell a service to a customer for 6000 euros and we will deliver this service over 6 months, i.e. we will charge the client a monthly fee of 1000,- euros. 

We need to see the updated amount in the View panel of the Sales application. For example, after 2 months, we need to see the updated amount i.e. 4.000,- euros (instead of that we currently see only the purchased amount).

Can you help pls ? 

Avatar
Discard
Best Answer

Hello, it depends on your odoo version and you deployment option:

1- you can use OCA module here (not migrate to 16.0 for now) : https://apps.odoo.com/apps/modules/15.0/sale_order_invoice_amount/

2- you can use studio ou developper mode to create un computed field invoiced amount or to_invoice_amount. Feel free to ask me if you want more details for this part.

Code could be something like this: 

for record in self:
if record.invoice_ids:
total_invoices = sum(record.invoice_ids.filtered(lambda invoice: invoice.state != 'cancel').mapped('amount_total_signed'))
record['x_to_invoice_amount'] = record.amount_total - total_invoices
else:
record['x_to_invoice_amount'] = record.amount_total
Avatar
Discard