Commit a6900464 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting:

* rules: stop diverging on source/destination payment
  Those info are not supposed to be set on order/delivery (ie, there is no field for this)
* drop duplicated config
* set the source payment before finalising the sale invoice
parent d5942d1b
......@@ -49,8 +49,6 @@
<string>source_payment</string>
<string>destination_payment</string>
<string>price_currency</string>
<string>source_decision</string>
<string>destination_decision</string>
<string>source_administration</string>
<string>destination_administration</string>
<string>ledger</string>
......
......@@ -18,6 +18,16 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>divergence_provider</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_payment_tester</string> </value>
......
......@@ -18,6 +18,10 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>divergence_provider</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>destination_payment_tester</string> </value>
......
......@@ -18,6 +18,10 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>divergence_provider</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_payment_tester</string> </value>
......
......@@ -18,6 +18,16 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>divergence_provider</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_payment_tester</string> </value>
......
......@@ -18,6 +18,16 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>divergence_provider</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_payment_tester</string> </value>
......
......@@ -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