Commit 2611612f authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: creation causality link between the deposit payment and invoice

parent b8ae2cef
......@@ -23,6 +23,14 @@ if invoice.getCausality(None) is None:
causality_list.append(causality)
invoice.setCausalityList(causality_list)
# Link the Invoice to the original Deposit payment
# this allow the invoice and payment to be automatilly grouped (lettering)
if invoice.getCausality(None) is not None:
new_causality = invoice.getCausalityValue()
original_payment = new_causality.getCausalityValue(None, portal_type="Payment Transaction")
if original_payment is not None:
original_payment.setCausalityList(original_payment.getCausalityList() + [invoice.getRelativeUrl()])
comment = translateString('Initialised by Delivery Builder.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment