Commit 001b1b4b authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: set the source payment before finalising the sale invoice

parent c870f631
......@@ -3,5 +3,8 @@ from Products.ERP5Type.Message import translateString
comment = translateString('Initialised by Delivery Builder.')
isTransitionPossible = context.getPortalObject().portal_workflow.isTransitionPossible
if context.getSourcePayment("") == "":
context.setSourcePayment(context.AccountingTransaction_getSourcePaymentItemList()[-1][1])
if isTransitionPossible(context, 'startBuilding'):
context.startBuilding(comment=comment)
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