Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
9 Відповіді
7285 Переглядів

Is it possible to automatically create Invoice drafts via subscriptions in Odoo V16?


In V15 you can set within the subscription template what Odoo should do with the invoice. (Create a draft, send invoice automatically, etc.) As far as I see there is no such option in V16. Invoices are always automaticaly created, confirmed and sent. It seems that there is no chance for checking or editing those invoices.

I couldn't find any details in the documentation as it concerns only V15.

Any Advice?

thanks a lot


Аватар
Відмінити

According to Odoo this function has been removed. Strange...

https://github.com/odoo/odoo/issues/118858

People, please add your comment on Github and here why this absolutely needs to come back! Thanks y'all!

Автор

Sehr geehrte/r AbsenderIn,

ich bin ab 19.06.2023 wieder für Sie erreichbar.

Für Anliegen zur Ihrem Projekt wenden Sie sich bitte an meinen Kollegen Robert Förster (robert@suppliot.eu).

In dringenden Fällen wenden Sie sich bitte an unseren Support - +43 1 774 03 92 – 400.

E-Mails werden nicht weitergeleitet.

vielen Dank und beste Grüße

Gottfried Brandi

Hello, I have exactly the same problem. Any solution?


No there is no solution yet, they will probably release it in a new version 17+.

According to Odoo this function has been removed.
See: https://github.com/odoo/odoo/issues/118858

People, please add your comment on Github and here why this absolutely needs to come back! Thanks y'all!

Найкраща відповідь

To ensure that all related invoices are consistently created in draft form, a recommended approach would be to clone the 'Sale Subscription: generate recurring invoices and payments' scheduled action and then deactivate the original one. Replace Python code with this snippet:


current_date = datetime.datetime.now()
search_domain = model.search([('is_batch', '=', False),
                         ('is_invoice_cron', '=', False),
                         ('is_subscription', '=', True),
                         ('subscription_management', '!=', 'upsell'),
                         ('state', 'in', ['sale', 'done']),
                         ('payment_exception', '=', False),
                         '&', '|', ('next_invoice_date', '<=', current_date), ('end_date', '<=', current_date), ('stage_category', '=', 'progress')])

for subs in search_domain:
  try:
    account_move = subs._create_recurring_invoice()
    #log(str(account_move))
  except Exception as e:
    continue


This way, you can maintain control over the invoice creation process but all will be generated in draft state.




Аватар
Відмінити

This code doesn't seem to be complete

Thanks Vladimir. It's correct now.

Найкраща відповідь

my case was to have this option for Creation invoices as manual for all subscriptions and solution is modification a scheduler

Sale Subscription: generate recurring invoices and payments

and replace a function with 

model._create_recurring_invoice(automatic=False)


Аватар
Відмінити

It's important to note that with the proposed modification, if the system encounters any draft invoices linked to a subscription, the scheduled task may cease to process subsequent subscriptions.

Найкраща відповідь

Hi,
Use this app:  https://apps.odoo.com/apps/modules/16.0/od_subscription_draft_invoice

Thanks

Аватар
Відмінити
Найкраща відповідь

A work-around could be disable the scheduled action "Sale subscription: generate recurring ..." and create a new one calling to the button action on form "action_invoice_subsction()" only for active subscription with pending invoices.

This action creates the invoices in draft state.

I have not the code, but it's easy.

Аватар
Відмінити
Найкраща відповідь

Same problem here. 

Found a small workaround, where i set the invoice items to "Based on Delivered Quantities" (Per Invoice ITEM)

I would like some subscriptions to invoice automatically.. and some manual.. like we had it before.. (Per Customer/Subscription)


Аватар
Відмінити
Найкраща відповідь

I don't think that there is a real solution for the moment despite  work arounds that might be different depending on use cases. In top of all this it will add in the invoice, at each product line the period even if it does not mean anything in your case. Before it was only mentioned once at the bottom of the invoice. 

Аватар
Відмінити

Yes I wish I was in the Odoo offices to talk about this problem... No one @Odoo seems to care and thinks they are right.

Maybe we should post something on LinkedIn to try to find out who is the product owner and get in touch with him. Wondering if he saw the GitHub comments.

Найкраща відповідь

Unfortunately there is no "invoicing" tab in my database either. No invisible views as far as I can see...
Also when I check v16.2, on runbot.odoo.com there also no invoicing tab there.

This is very annoying as now some previously 'draft invoice' subscriptions are invoiced anyway and sent to the customer...
And some automatic invoices aren't even invoiced.

This is terrible.

Аватар
Відмінити
Найкраща відповідь

Hello,

I had the same issue. After reviewing the Odoo native code, i find out that they done major changes that make the draft invoice process impossible without modification. 

The workaround proposed by Ricardo on this topic doesn't fit because it's considering a lot of products as "non delivered" and so just make the next invoice date increment without creating any invoices. 

As it was mandatory for our activity i created a module that overwrite the new Odoo process and get back the ability to invoice in draft again. 

For those who want to implement the same solution, you can buy the fresh made module here : 

https://apps.odoo.com/apps/modules/16.0/beone_sub_draft_invoice/ 

To make it work you just need to edit the recurrence model (sale.temporal.recurrence) in Subscriptions > Configuration > Recurrence Period. 

Just tick the new checkbox "Draft Invoice" and all the subscriptions for that recurrence will be done in draft. 

So to manage two types (one that post automatically and the other in draft) you'll need to have 2 (for exemple) "Monthly" recurrence. One you name "Monthly Auto" with the checkbox unchecked and the other you name "Monthly Draft" with the checkbox checked. 


Аватар
Відмінити
Найкраща відповідь

To create a draft invoice, you need to set the "Invoice Policy" to "Create draft invoice" in the subscription template. This will ensure that a draft invoice is generated for each billing cycle of the subscription.

Here are the steps to configure this in Odoo V16:

  1. Go to the "Subscription" menu in the Odoo interface.

  2. Select the subscription template for which you want to set the invoicing settings.

  3. Click on the "Invoicing" tab.

  4. In the "Invoice Policy" field, select "Create draft invoice".

  5. Save the changes to the subscription template.


Аватар
Відмінити
Автор

Thank you for your answer. Unfortunately there is no "invoicing" tab in my database. I also have checked if it is set invisible in Odoo Studio. I have uploaded a Screenshot in my initial post.

Related Posts Відповіді Переглядів Дія
3
серп. 25
2258
1
трав. 25
2524
1
квіт. 25
3503
1
квіт. 25
4338
1
квіт. 25
1804