Commit c85f4778 authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Xiaowu Zhang

erp5_invoicing: import from production

parent fe06ea7a
......@@ -26,5 +26,20 @@ for line in line_list:
line.setResource(None)
assert line.getResource() == resource
# XXX Jérome: this is not backported yet.
# If payments transactions were already built, we update these
# payment transactions causalities to add this new invoice.
payment_transaction_set = set([])
for delivery in context.getCausalityValueList():
payment_transaction_set.update(
delivery.getCausalityRelatedValueList(portal_type='Payment Transaction'))
for order in delivery.getCausalityValueList():
payment_transaction_set.update(
order.getCausalityRelatedValueList(portal_type='Payment Transaction'))
for payment_transaction in payment_transaction_set:
if context not in payment_transaction.getCausalityValueList():
payment_transaction.setCausalityValueList(payment_transaction.getCausalityValueList() + [context])
# round debit / credit on created transaction.
context.AccountingTransaction_roundDebitCredit()
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