Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4048 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Nov 24
1014
0
Jan 25
1025
1
Apr 24
1291
1
Okt 20
4304
0
Mar 15
5102