Skip to Content
Menu
To pytanie dostało ostrzeżenie
3 Odpowiedzi
1937 Widoki

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?


Awatar
Odrzuć

Same issue, somebody with the answer?


Najlepsza odpowiedź

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. 

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

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

C.

Awatar
Odrzuć
Najlepsza odpowiedź


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')}"



Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sty 24
1834
2
maj 25
1859
0
lip 23
1744