From 4ebf5f105c715dd537ce709cdde0481c8ffccb19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 26 May 2009 12:43:25 +0000
Subject: [PATCH] changes to item selection dialog. There are still some TODOs

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27187 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../select_item_fast_input.xml                |  95 +++++++
 .../select_item_fast_input.xml                |   2 +-
 .../DeliveryLine_getSelectableItemList.xml    |  93 +++----
 .../erp5_item/DeliveryLine_selectItemList.xml | 120 +++++---
 ...eliveryLine_updateSelectItemListDialog.xml |  74 +----
 .../DeliveryLine_viewSelectItemListDialog.xml |  11 +-
 .../listbox.xml                               |  84 ++----
 .../listbox_quantity.xml                      |   5 +
 ...eference.xml => listbox_quantity_unit.xml} |  52 +++-
 .../listbox_title.xml                         |  95 -------
 .../listbox_variation_category_list.xml       |  28 +-
 .../{my_type.xml => your_portal_type.xml}     |   6 +-
 .../your_reference.xml                        | 263 ++++++++++++++++++
 ...box_selection_check.xml => your_title.xml} | 100 ++++++-
 bt5/erp5_item/bt/revision                     |   2 +-
 bt5/erp5_item/bt/template_action_path_list    |   1 +
 16 files changed, 681 insertions(+), 350 deletions(-)
 create mode 100644 bt5/erp5_item/ActionTemplateItem/portal_types/Internal%20Packing%20List%20Line/select_item_fast_input.xml
 rename bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/{listbox_reference.xml => listbox_quantity_unit.xml} (58%)
 delete mode 100644 bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_title.xml
 rename bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/{my_type.xml => your_portal_type.xml} (96%)
 create mode 100644 bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_reference.xml
 rename bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/{listbox_selection_check.xml => your_title.xml} (59%)

diff --git a/bt5/erp5_item/ActionTemplateItem/portal_types/Internal%20Packing%20List%20Line/select_item_fast_input.xml b/bt5/erp5_item/ActionTemplateItem/portal_types/Internal%20Packing%20List%20Line/select_item_fast_input.xml
new file mode 100644
index 0000000000..33a02258ce
--- /dev/null
+++ b/bt5/erp5_item/ActionTemplateItem/portal_types/Internal%20Packing%20List%20Line/select_item_fast_input.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_fast_input</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>select_item_fast_input</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>Modify portal content</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>4.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Select Items</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/DeliveryLine_viewSelectItemListDialog?reset=1</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>python: object.getResource() and object.getResourceValue().getAggregatedPortalTypeList()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/ActionTemplateItem/portal_types/Sale%20Packing%20List%20Line/select_item_fast_input.xml b/bt5/erp5_item/ActionTemplateItem/portal_types/Sale%20Packing%20List%20Line/select_item_fast_input.xml
index 9d1a6f867b..33a02258ce 100644
--- a/bt5/erp5_item/ActionTemplateItem/portal_types/Sale%20Packing%20List%20Line/select_item_fast_input.xml
+++ b/bt5/erp5_item/ActionTemplateItem/portal_types/Sale%20Packing%20List%20Line/select_item_fast_input.xml
@@ -71,7 +71,7 @@
       <dictionary>
         <item>
             <key> <string>text</string> </key>
-            <value> <string>string:${object_url}/DeliveryLine_viewSelectItemListDialog</string> </value>
+            <value> <string>string:${object_url}/DeliveryLine_viewSelectItemListDialog?reset=1</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_getSelectableItemList.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_getSelectableItemList.xml
index fed97258c2..3eb4b81e7d 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_getSelectableItemList.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_getSelectableItemList.xml
@@ -54,48 +54,44 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>from Products.ERP5Type.Document import newTempBase\n
+from Products.ERP5Type.Utils import cartesianProduct\n
 portal = context.getPortalObject()\n
-if context.getPortalType()==\'Sale Packing List Line\':\n
-  cell_portal_type = \'Sale Packing List Cell\'\n
-elif context.getPortalType()==\'Inventory Line\':\n
-  cell_portal_type = \'Inventory Cell\'\n
-elif context.getPortalType()==\'Internal Packing List Line\':\n
-  cell_portal_type = \'Internal Packing List Cell\'\n
-result = [x.getObject() for x in context.portal_catalog(portal_type=\'Item\')]\n
-result_list = []\n
-new_list = filter(\n
-       lambda x :(x.Item_getResourceTitle()==context.getResourceTitle()),\n
-                  result)\n
+request = portal.REQUEST\n
 \n
-splc_list= context.contentValues(portal_type=cell_portal_type)\n
+node = context.getSourceValue()\n
 \n
-if not splc_list:\n
-  return new_list\n
-for splc in splc_list:\n
-  item_list = filter(\n
-       lambda x :(x.Item_getVariationCategoryList()==splc.getVariationCategoryList()),\n
-                  new_list)\n
-  result_list.extend(item_list)\n
+tracking_parameters = {\n
+    \'node_uid\': node.getUid(),\n
+    \'resource_uid\': context.getResourceUid(),\n
 \n
-len_res_list = len(result_list)\n
+    \'item_catalog_title\': request.get(\'title\') or \'\',\n
+    \'item_catalog_reference\': request.get(\'reference\') or \'\',\n
+    \'item_catalog_portal_type\': request.get(\'portal_type\') or \'\',\n
+}\n
 \n
 \n
-result = []\n
+check_variation = bool(context.getVariationCategoryList())\n
+acceptable_variation_category_list = \\\n
+      cartesianProduct(context.getCellRange(base_id=\'movement\'))\n
 \n
-return result_list\n
-for item in result_list:\n
-  variation_list = item.Item_getVariationCategoryList()\n
-  if variation_list !=[]:\n
-    obj = newTempBase(portal,id="tmp_item_%s" % item.getId(), uid="new_item_%s" % item.getId())\n
-    obj.edit(title=item.Item_getResourceTitle(),\n
-           reference=item.getReference(),\n
-           size=variation_list[1],\n
-           quantity=item.getQuantity(),\n
-           quality_grade=variation_list[0],\n
-           variation_category_list =variation_list)\n
-    result.append(obj)\n
+result_set = dict()\n
+for tracking_brain in portal.portal_simulation.getCurrentTrackingList(\n
+                            **tracking_parameters):\n
+  item = tracking_brain.getObject()\n
+  \n
+  # XXX can this be done in SQL ?\n
+  if check_variation and \\\n
+      item.Item_getVariationCategoryList() not in\\\n
+      acceptable_variation_category_list:\n
+    continue\n
+  \n
+  # XXX can this be done in SQL ?\n
+  if item.Item_getCurrentSiteValue() != node:\n
+    continue\n
+    \n
+  result_set[item] = 1\n
 \n
-return result\n
+return result_set.keys()\n
 </string> </value>
         </item>
         <item>
@@ -136,27 +132,24 @@ return result\n
                             <string>kw</string>
                             <string>Products.ERP5Type.Document</string>
                             <string>newTempBase</string>
+                            <string>Products.ERP5Type.Utils</string>
+                            <string>cartesianProduct</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>portal</string>
-                            <string>cell_portal_type</string>
-                            <string>append</string>
-                            <string>$append0</string>
+                            <string>request</string>
+                            <string>node</string>
+                            <string>tracking_parameters</string>
+                            <string>bool</string>
+                            <string>check_variation</string>
+                            <string>acceptable_variation_category_list</string>
+                            <string>dict</string>
+                            <string>result_set</string>
                             <string>_getiter_</string>
-                            <string>x</string>
-                            <string>result</string>
-                            <string>result_list</string>
-                            <string>filter</string>
-                            <string>new_list</string>
-                            <string>splc_list</string>
-                            <string>splc</string>
-                            <string>item_list</string>
-                            <string>len</string>
-                            <string>len_res_list</string>
+                            <string>_apply_</string>
+                            <string>tracking_brain</string>
                             <string>item</string>
-                            <string>variation_list</string>
-                            <string>obj</string>
-                            <string>_getitem_</string>
+                            <string>_write_</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_selectItemList.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_selectItemList.xml
index 274136ec68..2c6f6b41a7 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_selectItemList.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_selectItemList.xml
@@ -56,39 +56,65 @@
             <value> <string>from Products.ERP5Type.Message import translateString\n
 item_list = []\n
 request = context.REQUEST\n
-total_quantity = 0.0 \n
-new_item_list =[]\n
-context.setAggregateValueList([])\n
-type = request.get("field_my_type")\n
-if context.getPortalType()==\'Sale Packing List Line\':\n
+portal = context.getPortalObject()\n
+getObject = portal.portal_catalog.getObject\n
+selection_tool = portal.portal_selections\n
+\n
+line_portal_type = context.getPortalType()\n
+\n
+if line_portal_type == \'Sale Packing List Line\':\n
   cell_portal_type = \'Sale Packing List Cell\'\n
-elif context.getPortalType()==\'Inventory Line\':\n
+elif line_portal_type == \'Inventory Line\':\n
   cell_portal_type = \'Inventory Cell\'\n
-elif context.getPortalType()==\'Internal Packing List Line\':\n
+elif line_portal_type == \'Internal Packing List Line\':\n
   cell_portal_type = \'Internal Packing List Cell\'\n
-base_id = \'movement\'\n
-splc_list= context.contentValues(portal_type=cell_portal_type)\n
-for line in kw.get(\'listbox\'): \n
-  if line[\'selection_check\']:\n
-    item = context.portal_catalog.getResultValue(\n
-                                    relative_url=line["listbox_key"].split("erp5/")[-1])\n
-    item_list.append(item)\n
-variation_dict = {}  \n
-for item in item_list:  \n
-  variation_list = item.Item_getVariationCategoryTitleList()\n
-  if variation_list not in variation_dict:\n
-    variation_dict[variation_list] = 0.0  \n
-  variation_dict[variation_list] = variation_dict[variation_list] + item.getQuantity()\n
-for cell in splc_list:\n
-  for item in item_list:\n
-    if item.Item_getVariationCategoryList() == cell.getVariationCategoryList():\n
-       new_item_list=[]\n
-       new_item_list.append(item)       \n
-       cell.setAggregateValueList(context.getAggregateValueList()+ new_item_list)\n
-       variation_cell_list = \',\'.join([x[0] for x in cell.getVariationCategoryItemList()])\n
-       cell.setQuantity(variation_dict[variation_cell_list])\n
+else:\n
+  raise NotImplementedError(\'Unknown line type %s\' % line_portal_type)\n
+\n
+\n
+# update selected uids \n
+selection_tool.updateSelectionCheckedUidList(\n
+    list_selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=request)\n
+uids = selection_tool.getSelectionCheckedUidsFor(list_selection_name)\n
+\n
+# XXX do we need to update quantity for this one ?\n
+# for now, this is not defined, so we\'ll always update quantities when using\n
+# this dialog\n
+update_quantity = 1\n
 \n
+for item_uid in uids:\n
+  item = getObject(item_uid)\n
+  item_variation = item.Item_getVariationCategoryList()\n
+  # if we have variation, find matching cell to add this item to the cell\n
+  if item_variation:\n
+    cell_found = None\n
+    for cell in context.getCellValueList(base_id=\'movement\'):\n
+      if cell.getVariationCategoryList() == item_variation:\n
+        cell_found = cell\n
+        break\n
+    if cell_found is not None:\n
+      movement_to_update = cell_found\n
+    else:\n
+      # TODO: what if the item variation is not in range ?\n
+      movement_to_update = context.newCell(base_id=\'movement\',\n
+                                           portal_type=cell_portal_type,\n
+                                           *item_variation)\n
+  else:\n
+    # no variation, we\'ll update the line itself\n
+    movement_to_update = context\n
 \n
+  if item not in movement_to_update.getAggregateValueList():\n
+    movement_to_update.setAggregateValueSet(\n
+      movement_to_update.getAggregateValueList() + [item])\n
+    if update_quantity:\n
+      if item.getQuantityUnit() != movement_to_update.getQuantityUnit():\n
+        raise NotImplementedError(\n
+          \'Quantity unit from the movement differs from quantity\'\n
+          \' unit on the item\')\n
+      movement_to_update.setQuantity(\n
+          movement_to_update.getQuantity() + item.getQuantity())\n
+  \n
+  \n
 return context.Base_redirect(form_id, keep_items=dict(\n
        portal_status_message=translateString(\'Items aggregated\')))\n
 </string> </value>
@@ -101,7 +127,7 @@ return context.Base_redirect(form_id, keep_items=dict(\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>form_id=\'view\',*args, **kw</string> </value>
+            <value> <string>form_id=\'view\', list_selection_name=\'\', uids=[], listbox=None, listbox_uid=[], *args, **kw</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -121,13 +147,17 @@ return context.Base_redirect(form_id, keep_items=dict(\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>5</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
                             <string>form_id</string>
+                            <string>list_selection_name</string>
+                            <string>uids</string>
+                            <string>listbox</string>
+                            <string>listbox_uid</string>
                             <string>args</string>
                             <string>kw</string>
                             <string>Products.ERP5Type.Message</string>
@@ -136,24 +166,22 @@ return context.Base_redirect(form_id, keep_items=dict(\n
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>request</string>
-                            <string>total_quantity</string>
-                            <string>new_item_list</string>
-                            <string>type</string>
+                            <string>portal</string>
+                            <string>getObject</string>
+                            <string>selection_tool</string>
+                            <string>line_portal_type</string>
                             <string>cell_portal_type</string>
-                            <string>base_id</string>
-                            <string>splc_list</string>
+                            <string>NotImplementedError</string>
+                            <string>update_quantity</string>
                             <string>_getiter_</string>
-                            <string>line</string>
-                            <string>_getitem_</string>
+                            <string>item_uid</string>
                             <string>item</string>
-                            <string>variation_dict</string>
-                            <string>variation_list</string>
-                            <string>_write_</string>
+                            <string>item_variation</string>
+                            <string>None</string>
+                            <string>cell_found</string>
                             <string>cell</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>x</string>
-                            <string>variation_cell_list</string>
+                            <string>movement_to_update</string>
+                            <string>_apply_</string>
                             <string>dict</string>
                           </tuple>
                         </value>
@@ -168,6 +196,10 @@ return context.Base_redirect(form_id, keep_items=dict(\n
             <value>
               <tuple>
                 <string>view</string>
+                <string></string>
+                <list/>
+                <none/>
+                <list/>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_updateSelectItemListDialog.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_updateSelectItemListDialog.xml
index d86ce70dd9..c258477606 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_updateSelectItemListDialog.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_updateSelectItemListDialog.xml
@@ -53,51 +53,15 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""\n
-  This script just returns what the user entered in\n
-  the fast input form.\n
-"""\n
-request= context.REQUEST\n
-item_list=[]\n
+            <value> <string>request = context.REQUEST\n
 portal = context.getPortalObject()\n
-Base_translateString = portal.Base_translateString\n
-if context.getPortalType()==\'Sale Packing List Line\':\n
-  cell_portal_type = \'Sale Packing List Cell\'\n
-elif context.getPortalType()==\'Inventory Line\':\n
-  cell_portal_type = \'Inventory Cell\'\n
-elif context.getPortalType()==\'Internal Packing List Line\':\n
-  cell_portal_type = \'Internal Packing List Cell\'\n
 \n
+# FIXME: this is a workaround, because if listbox is present in request.form, \n
+#   editable fields will be empty when re-displaying the dialog.\n
+request.form.pop(\'listbox\', None)\n
+request.other.pop(\'listbox\', None)\n
 \n
-for line in listbox: \n
-  if line["selection_check"]==1:\n
-    item = context.portal_catalog.getResultValue(\n
-                                    relative_url=line["listbox_key"].split("erp5/")[-1])\n
-    item_list.append(item)\n
-variation_dict = {}  \n
-for item in item_list:  \n
-  variation_list = item.Item_getVariationCategoryTitleList()\n
-  if variation_list not in variation_dict:\n
-    variation_dict[variation_list] = 0.0  \n
-  variation_dict[variation_list] = variation_dict[variation_list] + item.getQuantity()\n
-\n
-splc_list= context.contentValues(portal_type=cell_portal_type)\n
-variation_cell_dict = {}\n
-for splc in splc_list:\n
-  variation_cell_list = \',\'.join([x[0] for x in splc.getVariationCategoryItemList()])\n
-  variation_cell_dict[variation_cell_list]= splc.getQuantity()\n
-final_variation_dict={}\n
-\n
-for key in variation_dict:\n
-    final_variation_dict[key] = "%s/%s"%(variation_cell_dict[key],variation_dict[key])\n
-\n
-\n
-request.set(\'portal_status_message\',\n
-          Base_translateString(\n
-               \'Quantity Defined On Packing List %s\' %(final_variation_dict)))\n
-\n
-context.Base_updateDialogForm(listbox=listbox)\n
-return context.DeliveryLine_viewSelectItemListDialog(**kw)\n
+return getattr(context, dialog_id)(**kw)\n
 </string> </value>
         </item>
         <item>
@@ -108,7 +72,7 @@ return context.DeliveryLine_viewSelectItemListDialog(**kw)\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>listbox=[],**kw</string> </value>
+            <value> <string>dialog_id, listbox=[], **kw</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -128,38 +92,22 @@ return context.DeliveryLine_viewSelectItemListDialog(**kw)\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>2</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
+                            <string>dialog_id</string>
                             <string>listbox</string>
                             <string>kw</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>request</string>
-                            <string>item_list</string>
                             <string>portal</string>
-                            <string>Base_translateString</string>
-                            <string>cell_portal_type</string>
-                            <string>_getiter_</string>
-                            <string>line</string>
-                            <string>_getitem_</string>
-                            <string>item</string>
-                            <string>variation_dict</string>
-                            <string>variation_list</string>
-                            <string>_write_</string>
-                            <string>splc_list</string>
-                            <string>variation_cell_dict</string>
-                            <string>splc</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>x</string>
-                            <string>variation_cell_list</string>
-                            <string>final_variation_dict</string>
-                            <string>key</string>
+                            <string>None</string>
                             <string>_apply_</string>
+                            <string>getattr</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog.xml
index 68caf2e196..5448d2d08e 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog.xml
@@ -93,10 +93,8 @@
                     <value>
                       <list>
                         <string>listbox_quantity</string>
-                        <string>listbox_reference</string>
-                        <string>listbox_title</string>
-                        <string>listbox_selection_check</string>
                         <string>listbox_variation_category_list</string>
+                        <string>listbox_quantity_unit</string>
                       </list>
                     </value>
                 </item>
@@ -107,14 +105,17 @@
                         <string>my_resource_title</string>
                         <string>my_total_quantity</string>
                         <string>my_quantity_unit</string>
-                        <string>my_type</string>
                       </list>
                     </value>
                 </item>
                 <item>
                     <key> <string>right</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <string>your_portal_type</string>
+                        <string>your_title</string>
+                        <string>your_reference</string>
+                      </list>
                     </value>
                 </item>
               </dictionary>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox.xml
index dccc4a3b40..834a8eb494 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox.xml
@@ -15,14 +15,12 @@
               <list>
                 <string>title</string>
                 <string>columns</string>
-                <string>all_columns</string>
-                <string>search_columns</string>
                 <string>sort</string>
                 <string>list_method</string>
                 <string>selection_name</string>
                 <string>default_params</string>
+                <string>select</string>
                 <string>editable_columns</string>
-                <string>enabled</string>
               </list>
             </value>
         </item>
@@ -64,10 +62,6 @@
             <key> <string>tales</string> </key>
             <value>
               <dictionary>
-                <item>
-                    <key> <string>all_columns</string> </key>
-                    <value> <string></string> </value>
-                </item>
                 <item>
                     <key> <string>columns</string> </key>
                     <value> <string></string> </value>
@@ -80,10 +74,6 @@
                     <key> <string>editable_columns</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>enabled</string> </key>
-                    <value> <string></string> </value>
-                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
@@ -96,18 +86,10 @@
                     <key> <string>list_method</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>search_columns</string> </key>
-                    <value> <string></string> </value>
-                </item>
                 <item>
                     <key> <string>selection_name</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>sort</string> </key>
-                    <value> <string></string> </value>
-                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
@@ -124,7 +106,7 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>all_columns</string> </key>
+                    <key> <string>columns</string> </key>
                     <value>
                       <list>
                         <tuple>
@@ -139,32 +121,17 @@
                           <string>quantity</string>
                           <string>Quantity</string>
                         </tuple>
-                      </list>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>columns</string> </key>
-                    <value>
-                      <list>
-                        <tuple>
-                          <string>selection_check</string>
-                          <string>Select</string>
-                        </tuple>
                         <tuple>
-                          <string>title</string>
-                          <string>Lot Title</string>
+                          <string>quantity_unit</string>
+                          <string>Quantity Unit</string>
                         </tuple>
                         <tuple>
-                          <string>reference</string>
-                          <string>Lot Reference</string>
-                        </tuple>
-                        <tuple>
-                          <string>quantity</string>
-                          <string>Quantity</string>
+                          <string>variation_category_list</string>
+                          <string>Variation</string>
                         </tuple>
                         <tuple>
-                          <string>Item_getVariationCategoryTitleList</string>
-                          <string>Variation</string>
+                          <string>translated_validation_state_title</string>
+                          <string>State</string>
                         </tuple>
                       </list>
                     </value>
@@ -180,27 +147,27 @@
                     <value>
                       <list>
                         <tuple>
-                          <string>selection_check</string>
-                          <string>Select</string>
+                          <string>variation_category_list</string>
+                          <string>Variation</string>
                         </tuple>
                         <tuple>
-                          <string>Item_getVariationCategoryTitleList</string>
-                          <string>Variation</string>
+                          <string>quantity</string>
+                          <string>Quantity</string>
+                        </tuple>
+                        <tuple>
+                          <string>quantity_unit</string>
+                          <string>Quantity Unit</string>
                         </tuple>
                       </list>
                     </value>
                 </item>
-                <item>
-                    <key> <string>enabled</string> </key>
-                    <value> <int>1</int> </value>
-                </item>
                 <item>
                     <key> <string>field_id</string> </key>
-                    <value> <string>my_order_sub_lines_listbox</string> </value>
+                    <value> <string>my_view_mode_listbox</string> </value>
                 </item>
                 <item>
                     <key> <string>form_id</string> </key>
-                    <value> <string>OrderLine_viewFieldLibrary</string> </value>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
                 </item>
                 <item>
                     <key> <string>list_method</string> </key>
@@ -209,19 +176,22 @@
                     </value>
                 </item>
                 <item>
-                    <key> <string>search_columns</string> </key>
-                    <value>
-                      <list/>
-                    </value>
+                    <key> <string>select</string> </key>
+                    <value> <int>1</int> </value>
                 </item>
                 <item>
                     <key> <string>selection_name</string> </key>
-                    <value> <string>item_fast_input_selection</string> </value>
+                    <value> <string>select_item_fast_input_selection</string> </value>
                 </item>
                 <item>
                     <key> <string>sort</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <tuple>
+                          <string>int_index</string>
+                          <string>ascending</string>
+                        </tuple>
+                      </list>
                     </value>
                 </item>
                 <item>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_quantity.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_quantity.xml
index 274e8607d5..2f1b754557 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_quantity.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_quantity.xml
@@ -14,6 +14,7 @@
             <value>
               <list>
                 <string>enabled</string>
+                <string>editable</string>
               </list>
             </value>
         </item>
@@ -82,6 +83,10 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
                 <item>
                     <key> <string>enabled</string> </key>
                     <value> <int>1</int> </value>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_reference.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_quantity_unit.xml
similarity index 58%
rename from bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_reference.xml
rename to bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_quantity_unit.xml
index 21c157b067..0f4ba5b843 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_reference.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_quantity_unit.xml
@@ -12,12 +12,16 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list/>
+              <list>
+                <string>title</string>
+                <string>items</string>
+                <string>editable</string>
+              </list>
             </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>listbox_reference</string> </value>
+            <value> <string>listbox_quantity_unit</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -61,10 +65,20 @@
                     <key> <string>form_id</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -72,22 +86,52 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
-                    <value> <string>my_reference</string> </value>
+                    <value> <string>my_list_field</string> </value>
                 </item>
                 <item>
                     <key> <string>form_id</string> </key>
-                    <value> <string>DeliveryCell_viewFieldLibrary</string> </value>
+                    <value> <string>Base_viewTradeFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list/>
+                    </value>
                 </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string>Click to edit the target</string> </value>
                 </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Quantity Unit</string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: getattr(here.portal_categories.quantity_unit, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_title.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_title.xml
deleted file mode 100644
index 12d126e31f..0000000000
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_title.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>delegated_list</string> </key>
-            <value>
-              <list/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>listbox_title</string> </value>
-        </item>
-        <item>
-            <key> <string>message_values</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>external_validator_failed</string> </key>
-                    <value> <string>The input failed the external validator.</string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-        <item>
-            <key> <string>overrides</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>extra_context</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>field_id</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>form_id</string> </key>
-                    <value> <string></string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-        <item>
-            <key> <string>tales</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>extra_context</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>field_id</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>form_id</string> </key>
-                    <value> <string></string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-        <item>
-            <key> <string>values</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>extra_context</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>field_id</string> </key>
-                    <value> <string>my_title</string> </value>
-                </item>
-                <item>
-                    <key> <string>form_id</string> </key>
-                    <value> <string>OrderLine_viewFieldLibrary</string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_variation_category_list.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_variation_category_list.xml
index cec242f06e..38d4b94d8b 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_variation_category_list.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_variation_category_list.xml
@@ -131,9 +131,7 @@
                 </item>
                 <item>
                     <key> <string>enabled</string> </key>
-                    <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
-                    </value>
+                    <value> <string></string> </value>
                 </item>
                 <item>
                     <key> <string>external_validator</string> </key>
@@ -154,7 +152,7 @@
                 <item>
                     <key> <string>items</string> </key>
                     <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
                     </value>
                 </item>
                 <item>
@@ -204,7 +202,7 @@
                 </item>
                 <item>
                     <key> <string>editable</string> </key>
-                    <value> <int>1</int> </value>
+                    <value> <int>0</int> </value>
                 </item>
                 <item>
                     <key> <string>enabled</string> </key>
@@ -273,7 +271,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: cell.Item_getVariationCategoryList()</string> </value>
+            <value> <string>cell/Item_getVariationCategoryList</string> </value>
         </item>
       </dictionary>
     </pickle>
@@ -289,23 +287,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: cell.getAggregateRelatedValue().getVariationRangeCategoryItemList(display_base_category = 0)</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-  <record id="4" aka="AAAAAAAAAAQ=">
-    <pickle>
-      <tuple>
-        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_text</string> </key>
-            <value> <string>python: cell.getAggregateRelatedValue().getVariationRangeCategoryItemList(display_base_category = 0)</string> </value>
+            <value> <string>cell/Item_getVariationRangeCategoryItemList</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/my_type.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_portal_type.xml
similarity index 96%
rename from bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/my_type.xml
rename to bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_portal_type.xml
index ce097ce097..a3500a9d47 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/my_type.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_portal_type.xml
@@ -11,7 +11,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>my_type</string> </value>
+            <value> <string>your_portal_type</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -248,7 +248,7 @@
                 </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>Type</string> </value>
+                    <value> <string>Item Type</string> </value>
                 </item>
                 <item>
                     <key> <string>unicode</string> </key>
@@ -275,7 +275,7 @@
       <dictionary>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string>python: here.getResource() and  [(x, x) for x in here.getResourceValue().getAggregatedPortalTypeList()] or [(\'\', \'\')]</string> </value>
+            <value> <string>python: [(\'\', \'\')]  + (here.getResource() and  [(here.Base_translateString(x), x) for x in here.getResourceValue().getAggregatedPortalTypeList()] or [])</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_reference.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_reference.xml
new file mode 100644
index 0000000000..ca98b8e920
--- /dev/null
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_reference.xml
@@ -0,0 +1,263 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="StringField" module="Products.Formulator.StandardFields"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>your_reference</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was given.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>alternate_name</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>css_class</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <int>20</int> </value>
+                </item>
+                <item>
+                    <key> <string>editable</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
+                <item>
+                    <key> <string>external_validator</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Item Reference</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_selection_check.xml b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_title.xml
similarity index 59%
rename from bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_selection_check.xml
rename to bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_title.xml
index c3fd5875fc..fb476c4041 100644
--- a/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/listbox_selection_check.xml
+++ b/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/DeliveryLine_viewSelectItemListDialog/your_title.xml
@@ -3,7 +3,7 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
+        <global name="StringField" module="Products.Formulator.StandardFields"/>
         <tuple/>
       </tuple>
     </pickle>
@@ -11,7 +11,7 @@
       <dictionary>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>listbox_selection_check</string> </value>
+            <value> <string>your_title</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -21,6 +21,14 @@
                     <key> <string>external_validator_failed</string> </key>
                     <value> <string>The input failed the external validator.</string> </value>
                 </item>
+                <item>
+                    <key> <string>required_not_found</string> </key>
+                    <value> <string>Input is required but no input given.</string> </value>
+                </item>
+                <item>
+                    <key> <string>too_long</string> </key>
+                    <value> <string>Too much input was given.</string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -44,6 +52,14 @@
                     <key> <string>description</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>editable</string> </key>
                     <value> <string></string> </value>
@@ -64,10 +80,30 @@
                     <key> <string>hidden</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>title</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -91,6 +127,14 @@
                     <key> <string>description</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>editable</string> </key>
                     <value> <string></string> </value>
@@ -111,10 +155,30 @@
                     <key> <string>hidden</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>title</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -132,12 +196,20 @@
                 </item>
                 <item>
                     <key> <string>default</string> </key>
-                    <value> <int>0</int> </value>
+                    <value> <string></string> </value>
                 </item>
                 <item>
                     <key> <string>description</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>display_maxwidth</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>display_width</string> </key>
+                    <value> <int>20</int> </value>
+                </item>
                 <item>
                     <key> <string>editable</string> </key>
                     <value> <int>1</int> </value>
@@ -158,9 +230,29 @@
                     <key> <string>hidden</string> </key>
                     <value> <int>0</int> </value>
                 </item>
+                <item>
+                    <key> <string>max_length</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>required</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
                 <item>
                     <key> <string>title</string> </key>
-                    <value> <string>Select</string> </value>
+                    <value> <string>Item Title</string> </value>
+                </item>
+                <item>
+                    <key> <string>truncate</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>unicode</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <int>0</int> </value>
                 </item>
               </dictionary>
             </value>
diff --git a/bt5/erp5_item/bt/revision b/bt5/erp5_item/bt/revision
index 176fdebf1b..8bc6583717 100644
--- a/bt5/erp5_item/bt/revision
+++ b/bt5/erp5_item/bt/revision
@@ -1 +1 @@
-119
\ No newline at end of file
+120
\ No newline at end of file
diff --git a/bt5/erp5_item/bt/template_action_path_list b/bt5/erp5_item/bt/template_action_path_list
index 5f93543a09..7017739de7 100644
--- a/bt5/erp5_item/bt/template_action_path_list
+++ b/bt5/erp5_item/bt/template_action_path_list
@@ -1,4 +1,5 @@
 Internal Packing List Line | item_creation
+Internal Packing List Line | select_item_fast_input
 Internal Packing List | aggregate_item
 Item Module | create_order
 Item Module | view
-- 
2.30.9