Skip to Content
Menú
This question has been flagged
3 Respostes
1852 Vistes

Normally automatic invoice sent to customer will be note on Label in voice like 3 months is base on next invoice date was set on Subscription. Example next invoice date: 01 April 2024 and subscription 3 months. then the label in the invoice will be note: 3 months 01/04/2024 - 01/07/2024.   

As I want to set to send invoice for customer 1 month head before subscription expired. base on above i want invoice label note 3 months 01/05/2024 - 01/08/2024. how can i set up like this?


Avatar
Descartar

Same issue, somebody with the answer?


Best Answer

Experiencing the exact same issue. Did you find any way around?

Alternatively, if I'm not mistaken you can extend the "automatic closing after", but our clients also requested to receive the invoice 1 month prior to the end of the subscription. 

Avatar
Descartar
Best Answer

Hi,

In the product form, have you tried changing the Invoicing Policy to "Prepaid/Fixed Price"?

C.

Avatar
Descartar
Best Answer


Option 1: Use Studio or Custom Code to Offset the Period Label

  1. Activate Developer Mode
    Go to Settings → Activate Developer Mode.
  2. Use Odoo Studio or create a custom module to override the invoice description generation logic:
    • In the model sale.subscription, the logic for label text (e.g., “3 months 01/04/2024 - 01/07/2024”) is usually built into the method that generates the invoice line description.
    • You'll need to override that method (e.g., _prepare_invoice_line) and add a 1-month offset to the dates used in the label.

Phyton Code
start_date = subscription.recurring_next_date + relativedelta(months=1)
Deploy the code or use Studio to set the computed field in the invoice line description with the adjusted label.

end_date = start_date + relativedelta(months=subscription.recurring_interval)

label = f"{subscription.recurring_interval} months {start_date.strftime('%d/%m/%Y')} - {end_date.strftime('%d/%m/%Y')}"



Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de gen. 24
1770
2
de maig 25
1775
0
de jul. 23
1690