Commit 53144c71 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

update divergence solving dialog.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32387 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 625796a5
......@@ -53,10 +53,24 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX currently we create a temporary Solver Process and build temporary Solver Decision in it.\n
# But for better performance, Solver Process and Solver Decision should be created by causality\n
# workflow when a delivery becomes divergent.\n
solver_process = context.getPortalObject().portal_solvers.newSolverProcess(context, temp_object=True)\n
<value> <string># XXX currently we create a Solver Process and build Solver Decision in it if missing.\n
# But for better performance, Solver Process and Solver Decision should be created beforehand\n
# by causality workflow when a delivery becomes divergent.\n
solver_process = None\n
solver_list = context.getSolverValueList()\n
for i in solver_list:\n
# XXX if \'solving\' decision exists, what should we do?\n
if i.getSolverState() != \'solved\':\n
solver_process = i\n
break\n
context.log(solver_process)\n
if solver_process is None:\n
context.log(solver_process)\n
solver_process = context.getPortalObject().portal_solvers.newSolverProcess(context)\n
context.log(solver_process)\n
solver_list.append(solver_process.getRelativeUrl())\n
context.setSolverList(solver_list)\n
# XXX should omit \'solved\' decision?\n
return solver_process.objectValues(portal_type=\'Solver Decision\')\n
</string> </value>
</item>
......@@ -95,10 +109,13 @@ return solver_process.objectValues(portal_type=\'Solver Decision\')\n
<value>
<tuple>
<string>kw</string>
<string>None</string>
<string>solver_process</string>
<string>_getattr_</string>
<string>context</string>
<string>True</string>
<string>solver_process</string>
<string>solver_list</string>
<string>_getiter_</string>
<string>i</string>
</tuple>
</value>
</item>
......
......@@ -58,12 +58,17 @@ listbox = request.get(\'listbox\')\n
line_list = context.Delivery_getSolverDecisionList(listbox=listbox)\n
for listbox_key in listbox:\n
listbox_dict = listbox[listbox_key]\n
line = [x for x in line_list if x.getId() == listbox_key][0]\n
line = [x for x in line_list if x.getPath() == listbox_key][0]\n
uid = line.getUid()\n
for property in (\'solver\', \'solver_parameter\', \'target_solver\', \'comment\',):\n
value = listbox_dict.get(property, \'\')\n
for property in (\'solver\', \'solver_configuration\', \'delivery_solver\', \'comment\',):\n
value = listbox_dict.get(property, None)\n
key = \'field_listbox_%s_%s\' % (property, uid)\n
request.form[key] = request.other[key] = value\n
if property == \'solver_configuration\':\n
if value is not None:\n
line.updateConfiguration(**value.as_dict())\n
else:\n
line.setProperty(property, value)\n
\n
return context.Delivery_viewSolveDivergenceDialog(listbox=listbox)\n
</string> </value>
......@@ -118,9 +123,11 @@ return context.Delivery_viewSolveDivergenceDialog(listbox=listbox)\n
<string>line</string>
<string>uid</string>
<string>property</string>
<string>None</string>
<string>value</string>
<string>key</string>
<string>_write_</string>
<string>_apply_</string>
</tuple>
</value>
</item>
......
......@@ -277,7 +277,11 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:request.get(\'listbox\', {}).get(cell.getId(), {}).get(\'solver\', \'\')</string> </value>
<value> <string encoding="cdata"><![CDATA[
python:request.get(\'listbox\', {}).get(cell.getPath(), {}).get(\'solver\', \'\') and len(cell.SolverDecision_getDeliverySolverList()) > 1
]]></string> </value>
</item>
</dictionary>
</pickle>
......@@ -293,7 +297,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getDeliverySolverList(cell.getId())</string> </value>
<value> <string>python:cell.SolverDecision_getDeliverySolverList()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -187,7 +187,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:request.get(\'listbox\', {}).get(cell.getId(), {}).get(\'solver\', \'\')</string> </value>
<value> <string>cell/getSolver</string> </value>
</item>
</dictionary>
</pickle>
......@@ -203,7 +203,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.Delivery_getSolverConfigurationFormId(cell.getId())</string> </value>
<value> <string>python:cell.getSolverValue().getConfigurationFormId()</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>try:\n
return [(\'\', \'\')] + [x for x in context.getPortalObject().portal_solvers.getDeliverySolverTranslatedItemList() \\\n
if x[1] in context.getSolverValue().getDeliverySolverList()]\n
except AttributeError:\n
return [(\'\', \'\')]\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>x</string>
<string>_getitem_</string>
<string>AttributeError</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SolverDecision_getDeliverySolverList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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