Commit a28fa3ef authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: set source_payment just before closing the invoice

parent baee6b01
......@@ -13,6 +13,9 @@ if (context.getSimulationState() == 'confirmed')\
and (0 < len(context.objectValues(portal_type="Sale Invoice Transaction Line"))\
and (context.getStopDate(now) < now)):
if context.getSourcePayment("") == "":
context.setSourcePayment(context.AccountingTransaction_getSourcePaymentItemList()[-1][1])
comment = 'Stopped by alarm as all actions in confirmed state are ready.'
if isTransitionPossible(context, 'start'):
context.start(comment=comment)
......
......@@ -3,8 +3,5 @@ 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