Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4047 Widoki

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


Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lis 24
1014
0
sty 25
1025
1
kwi 24
1291
1
paź 20
4304
0
mar 15
5101