Delivery_updateSolveDivergenceDialog.xml 3.49 KB
Newer Older
1 2 3 4
<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
5
      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
    </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>request= context.REQUEST\n
54 55
from Products.ERP5Type.Message import translateString\n
\n
56 57
listbox = request.get(\'listbox\')\n
line_list = context.Delivery_getSolverDecisionList(listbox=listbox)\n
58 59 60 61 62
\n
if len(line_list) == 0:\n
  message = translateString("Workflow state may have been updated by other user. Please try again.")\n
  return context.Base_redirect(form_id, keep_items={\'portal_status_message\': message}, **kw)\n
\n
63 64
for listbox_key in listbox:\n
  listbox_dict = listbox[listbox_key]\n
65
  line = [x for x in line_list if x.getPath() == listbox_key][0]\n
66
  uid = line.getUid()\n
67 68
  for property in (\'solver\', \'solver_configuration\', \'delivery_solver\', \'comment\',):\n
    value = listbox_dict.get(property, None)\n
69 70
    key = \'field_listbox_%s_%s\' % (property, uid)\n
    request.form[key] = request.other[key] = value\n
71 72 73 74 75
    if property == \'solver_configuration\':\n
      if value is not None:\n
        line.updateConfiguration(**value.as_dict())\n
    else:\n
      line.setProperty(property, value)\n
76
request.set(\'your_dialog_updated\', \'1\')\n
77 78 79 80 81
return context.Delivery_viewSolveDivergenceDialog(listbox=listbox)\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
82
            <value> <string>form_id=\'view\', listbox=[],**kw</string> </value>
83 84 85 86 87 88 89 90 91
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>Delivery_updateSolveDivergenceDialog</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>