Commit a032026d authored by Jérome Perrin's avatar Jérome Perrin

pass wf transition with workflow method if the user cannot pass with his rights


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4738 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9e5d5ac
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
# after the sale_invoice_builder delivery builder has created\n # after the sale_invoice_builder delivery builder has created\n
# the new Sale Invoice Transaction\n # the new Sale Invoice Transaction\n
#\n #\n
from ZODB.POSException import ConflictError \n
\n \n
sale_invoice = context\n sale_invoice = context\n
\n \n
...@@ -92,17 +93,23 @@ sale_invoice.edit(\n ...@@ -92,17 +93,23 @@ sale_invoice.edit(\n
title = related_packing_list.getTitle(),\n title = related_packing_list.getTitle(),\n
resource = price_currency,\n resource = price_currency,\n
price_currency = price_currency,\n price_currency = price_currency,\n
reference = related_packing_list.getReference(),\n
)\n )\n
\n \n
# initialize accounting_workflow to planned state\n # initialize accounting_workflow to planned state\n
if sale_invoice.getSimulationState() == \'draft\' : \n if sale_invoice.getSimulationState() == \'draft\' : \n
try :\n
context.getPortalObject().portal_workflow.doActionFor(\n context.getPortalObject().portal_workflow.doActionFor(\n
sale_invoice, \'plan_action\', wf_id=\'accounting_workflow\',\n sale_invoice, \'plan_action\', wf_id=\'accounting_workflow\',\n
comment = \'Initialized by Delivery Builder\'\n comment = \'Initialized by Delivery Builder\',\n
)\n skip_period_validation = 1 )\n
except (ConflictError, RuntimeError), e : raise\n
except Exception, e :\n
LOG(\'Exception in plan_action\', e)\n
# call the workflow method, if the user cannot perform this operation.\n
sale_invoice.plan()\n
\n \n
# First set the invoice in the building state on the causality workflow\n # First set the invoice in the building state on the causality workflow\n
#context.getPortalObject().portal_workflow.doActionFor(sale_invoice, \'start_building\', wf_id=\'invoice_causality_workflow\')\n
sale_invoice.startBuilding()\n sale_invoice.startBuilding()\n
\n \n
# Then an activity should put the causality state in diverged or solved\n # Then an activity should put the causality state in diverged or solved\n
...@@ -110,44 +117,50 @@ sale_invoice.startBuilding()\n ...@@ -110,44 +117,50 @@ sale_invoice.startBuilding()\n
sale_invoice.activate(\n sale_invoice.activate(\n
after_method_id = ( \'immediateReindexObject\',\n after_method_id = ( \'immediateReindexObject\',\n
\'recursiveImmediateReindexObject\',\n \'recursiveImmediateReindexObject\',\n
\'Delivery_confirm\'\n
)).updateCausalityState()\n )).updateCausalityState()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAAAAAAgAAAAQAAAACwAA <value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAAAAAA0AAAAYAAAACwAA
AHMzAQAAdAAAiQAAhwAAZAEAhgAAfQMAdAMAiAAAZAIAgwIAgwAAAXQDAIgAAGQDAIMCAIMAAH0F AHOrAQAAZAEAawAAbAEAfQIAAXQCAIkAAIcAAGQCAIYAAH0FAHQFAIgAAGQDAIMCAIMAAAF0BQCI
AHwDAGQEAHQDAIgAAGQFAIMCAIMAABaDAQABdAMAfAUAZAMAgwIAgwAAfQYAdAMAfAYAZAYAgwIA AABkBACDAgCDAAB9BwB8BQBkBQB0BQCIAABkBgCDAgCDAAAWgwEAAXQFAHwHAGQEAIMCAIMAAH0I
gwAAfQcAdAMAiAAAZAcAgwIAZAgAdAMAfAUAZAkAgwIAgwAAZAoAfAcAZAsAfAcAgwADAXQDAIgA AHQFAHwIAGQHAIMCAIMAAH0JAHQFAIgAAGQIAIMCAGQJAHQFAHwHAGQKAIMCAIMAAGQLAHwJAGQM
AGQMAIMCAIMAAGQNAGoCAG87AAF0AwB0AwB0AwB0AABkDgCDAgCDAABkDwCDAgBkEACDAgCIAABk AHwJAGQNAHQFAHwHAGQOAIMCAIMAAIMABAF0BQCIAABkDwCDAgCDAABkEABqAgBvlwABeUEAdAUA
EQB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AAAAU2FsZUludm9pY2VUcmFuc2Fj
dGlvbl9wb3N0R2VuZXJhdGlvbkFjdGl2aXR5AQAAAHMwAAAAAAUNAgYCDwQNAhIBGgMSARUDDwEP
AQYBCQEQBBkBDAEYASADHQEQARACGQMTBAwBKAEAAABzLQAAAFNhbGVJbnZvaWNlVHJhbnNhY3Rp
b25fcG9zdEdlbmVyYXRpb25BY3Rpdml0eSgBAAAAcy0AAABTYWxlSW52b2ljZVRyYW5zYWN0aW9u
X3Bvc3RHZW5lcmF0aW9uQWN0aXZpdHkoAAAAACgAAAAAcw8AAABTY3JpcHQgKFB5dGhvbilzCAAA
ADxtb2R1bGU+AQAAAHMAAAAA</string> </value>
</item> </item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
...@@ -182,6 +195,8 @@ aG9uKXMIAAAAPG1vZHVsZT4BAAAAcwAAAAA=</string> </value> ...@@ -182,6 +195,8 @@ aG9uKXMIAAAAPG1vZHVsZT4BAAAAcwAAAAA=</string> </value>
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>ZODB.POSException</string>
<string>ConflictError</string>
<string>context</string> <string>context</string>
<string>sale_invoice</string> <string>sale_invoice</string>
<string>LOG</string> <string>LOG</string>
...@@ -189,6 +204,9 @@ aG9uKXMIAAAAPG1vZHVsZT4BAAAAcwAAAAA=</string> </value> ...@@ -189,6 +204,9 @@ aG9uKXMIAAAAPG1vZHVsZT4BAAAAcwAAAAA=</string> </value>
<string>related_packing_list</string> <string>related_packing_list</string>
<string>related_order</string> <string>related_order</string>
<string>price_currency</string> <string>price_currency</string>
<string>RuntimeError</string>
<string>e</string>
<string>Exception</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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