Commit 0446ecfa authored by Jérome Perrin's avatar Jérome Perrin

Clean up PaymentTransaction_copyInvoiceProperties everything this script was...

Clean up PaymentTransaction_copyInvoiceProperties everything this script was doing can actually be done with movement groups.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18780 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 87ad2e8c
...@@ -65,34 +65,14 @@ ...@@ -65,34 +65,14 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>LOG = lambda msg:context.log("PaymentTransaction_copyInvoiceProperties", msg)\n <value> <string>from Products.ERP5Type.Message import Message\n
LOG = lambda msg:None\n
\n \n
payment_transaction = context\n payment_transaction = context\n
LOG("start, payment_transaction = %s @ %s"%(payment_transaction, payment_transaction.getPath()))\n
invoice_transaction = payment_transaction.getCausalityValue()\n
LOG("invoice_transaction = %s"%invoice_transaction)\n
\n \n
categories = {}\n if payment_transaction.getSimulationState() == "draft":\n
if invoice_transaction.getResourceValue() is not None : \n
categories[\'resource\'] = invoice_transaction.getResource()\n
\n
LOG("payment_transaction categories = %s" % categories )\n
payment_transaction.edit(\n
### FIXME: the date must be set on the simulation movement\n
start_date = invoice_transaction.TradeCondition_getDueDate()\n
, reference = invoice_transaction.getReference()\n
, **categories\n
)\n
\n
if payment_transaction.getSimulationState() == "draft": \n
payment_transaction.portal_workflow.doActionFor(\n payment_transaction.portal_workflow.doActionFor(\n
payment_transaction,\n payment_transaction, \'plan_action\',\n
\'plan_action\',\n comment=Message(\'erp5_ui\', "Initialized by Delivery Builder"))\n
comment="Initialized by Delivery Builder")\n
LOG("payment simulation state set to planned")\n
\n
LOG("end")\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -135,15 +115,11 @@ LOG("end")\n ...@@ -135,15 +115,11 @@ LOG("end")\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>LOG</string> <string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>context</string> <string>context</string>
<string>payment_transaction</string> <string>payment_transaction</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>invoice_transaction</string>
<string>categories</string>
<string>None</string>
<string>_write_</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
541 542
\ No newline at end of file \ No newline at end of file
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