Passa al contenuto
Menu
La domanda è stata contrassegnata
3 Risposte
1944 Visualizzazioni

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
Abbandona

Same issue, somebody with the answer?


Risposta migliore

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
Abbandona
Risposta migliore

Hi,

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

C.

Avatar
Abbandona
Risposta migliore


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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
gen 24
1839
2
mag 25
1864
0
lug 23
1750