Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4065 Prikazi

I have some Customer arrangements where I bill a subset of Customers the same amount each month, on the same date.

I use the same reference each time - with the month name appended:

GH-338478 - January


Avatar
Opusti
Best Answer

Odoo has a Subscription App that supports this, and many other features, like allowing your Customers to start, adjust, setup payment for and stop their subscription(s) via your website.

See https://www.odoo.com/app/subscriptions-features for details.


An alternative may be a Server Action following a similar approach to this:


for record in records:
date_of_next_invoice = record.invoice_date + dateutil.relativedelta.relativedelta(months=1)
if record.ref and ' - ' in record.ref:
new_ref = record.ref.partition(' - ')[0] + ' - ' + date_of_next_invoice.strftime("%B")
else:
new_ref = record.ref
new_invoice = record.copy()
new_invoice.write({
'ref': new_ref,
'invoice_date': record.invoice_date + dateutil.relativedelta.relativedelta(months=1),
'date': record.date + dateutil.relativedelta.relativedelta(months=1),
'invoice_payment_term_id': record.invoice_payment_term_id and record.invoice_payment_term_id.id,
'invoice_date_due': record.invoice_date_due and record.invoice_date_due + dateutil.relativedelta.relativedelta(months=1),
})
if ' - ' in new_ref:
new_invoice.action_post()


Be sure to click CREATE CONTEXTUAL ACTION so this shows up in the list of Customer Invoices:


Then, each month, filter the Invoices you want to have copied, and run the Server Action:


Note: This is an approach, not a robust solution for every Use Case, your Odoo Consultant or Odoo Partner can help you if you need support to get this working in your environment.  It has been quickly tested with v14 but there may be cases where it doesn't work correctly.

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
nov. 24
1018
0
jan. 25
1035
1
apr. 24
1292
1
okt. 20
4310
0
mar. 15
5108