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

generate invoices in confirmed state, and use a Message to have "Initialized...

generate invoices in confirmed state, and use a Message to have "Initialized by Delivery Builder" translated

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20590 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bd167aa1
......@@ -70,6 +70,7 @@
# after the invoice_builder delivery builder has created\n
# the new Sale Invoice Transaction\n
#\n
from Products.ERP5Type.Message import Message\n
try:\n
from Products.CMFCore.WorkflowCore import WorkflowException\n
except ImportError:\n
......@@ -113,8 +114,8 @@ if not invoice.getTitle():\n
if invoice.getSimulationState() == \'draft\':\n
try :\n
context.getPortalObject().portal_workflow.doActionFor(\n
invoice, \'plan_action\',\n
comment=\'Initialized by Delivery Builder\',\n
invoice, \'confirm_action\',\n
comment=Message(\'erp5_ui\', \'Initialized by Delivery Builder\'),\n
skip_period_validation=1)\n
except WorkflowException, e:\n
# The user cannot pass the transition, it\'s OK\n
......@@ -122,7 +123,7 @@ if invoice.getSimulationState() == \'draft\':\n
\n
if invoice.getSimulationState() == \'draft\':\n
# call the workflow method, if the user cannot perform this operation.\n
invoice.plan()\n
invoice.confirm()\n
\n
# First set the invoice in the building state on the causality workflow\n
invoice.startBuilding()\n
......@@ -180,6 +181,8 @@ invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list
<tuple>
<string>related_simulation_movement_path_list</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.CMFCore.WorkflowCore</string>
<string>WorkflowException</string>
<string>ImportError</string>
......
57
\ No newline at end of file
58
\ 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