Commit 337f70d3 authored by Jérome Perrin's avatar Jérome Perrin

simplify a bit related affectation creation dialogs and remove all unused fields

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27131 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 20f4aee7
......@@ -71,7 +71,7 @@ base_id = \'movement\'\n
for line in kw.get(\'listbox\'):\n
if line.has_key(\'listbox_key\') and line[\'quantity\'] in (\'\',None):\n
request.set(\'portal_status_message\', \n
Base_translateString(\'Please Define Quantity for Item Defined On Line %s\'%line[\'listbox_key\']))\n
translateString(\'Please Define Quantity for Item Defined On Line %s\'%line[\'listbox_key\']))\n
if line.has_key(\'listbox_key\') and (line[\'title\'] or line[\'reference\'] not in (\'\', None)):\n
module = context.getDefaultModule(type)\n
item = module.newContent(portal_type=type,\n
......@@ -160,7 +160,6 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<string>line</string>
<string>_getitem_</string>
<string>None</string>
<string>Base_translateString</string>
<string>module</string>
<string>item</string>
<string>append</string>
......
......@@ -63,7 +63,6 @@ stool = portal.portal_selections\n
getObject = portal.portal_catalog.getObject\n
\n
\n
stool.updateSelectionCheckedUidList(selection_name, listbox_uid, uids)\n
selection_uid_list = stool.getSelectionCheckedUidsFor(selection_name)\n
\n
if selection_uid_list:\n
......@@ -74,8 +73,6 @@ else:\n
source_section_list = [ item.Item_getCurrentOwnerValue() for item in object_list ]\n
\n
property_dict = {\'title\':title,\n
\'stop_date\' : stop_date,\n
\'start_date\' : start_date,\n
\'portal_type\' : portal_type, }\n
\n
module = context.getDefaultModule(portal_type=portal_type)\n
......@@ -95,8 +92,9 @@ for ss in source_section_list:\n
\n
if not pl_dict.has_key(uid):\n
pl_dict[uid] = module.newContent(**pl_property_dict)\n
pl_dict[uid].setSourceSectionValue(ss) \n
pl_dict[uid].setSourceSectionValue(ss)\n
\n
delivery_count = len(source_section_list)\n
\n
for item in object_list:\n
source_section = item.Item_getCurrentOwnerValue()\n
......@@ -104,7 +102,7 @@ for item in object_list:\n
if source_section.getUid() is not None:\n
pl_value = pl_dict[str(source_section.getUid())]\n
else:\n
pl_value = pl_dict[\'UID\']\n
pl_value = pl_dict[\'UID\']\n
\n
source = item.Item_getCurrentSiteValue() \n
resource = item.Item_getResourceValue()\n
......@@ -112,10 +110,9 @@ for item in object_list:\n
pl_line_dict = {}\n
pl_line_dict[\'portal_type\'] = line_portal_type\n
\n
pl_line_dict[\'title\']= \'%s\' % (item.getReference())\n
#pl_line_dict[\'aggregate_value_list\'] = [item]\n
pl_line_dict[\'quantity\'] = quantity\n
#pl_line_dict[\'quantity_unit\'] = quantity_unit\n
pl_line_dict[\'title\']= item.getReference()\n
pl_line_dict[\'quantity\'] = item.getQuantity()\n
pl_line_dict[\'quantity_unit\'] = item.getQuantityUnit()\n
pl_line_dict[\'resource_value\'] = resource\n
pl_line_dict[\'source_value\'] = source\n
pl_line_value = pl_value.newContent(**pl_line_dict)\n
......@@ -127,7 +124,7 @@ for item in object_list:\n
base_id = \'movement\'\n
cell_key_list = list(pl_line_value.getCellKeyList(base_id=base_id))\n
cell_key_list.sort()\n
for cell_key in cell_key_list: \n
for cell_key in cell_key_list:\n
cell = pl_line_value.newCell(base_id=base_id, \\\n
portal_type=cell_portal_type,*cell_key)\n
cell.edit(mapped_value_property_list=[\'price\',\'quantity\'],\n
......@@ -136,8 +133,15 @@ for item in object_list:\n
variation_category_list=cell_key)\n
cell.setAggregateValue(item)\n
\n
if delivery_count == 1:\n
return pl_value.Base_redirect(\'view\', keep_items=dict(\n
portal_status_message=translateString(\n
\'Items affected\')))\n
\n
return context.Base_redirect(form_id, keep_items=dict(\n
portal_status_message=translateString(\'Items affected\')))\n
portal_status_message=translateString(\n
\'Items affected in ${delivery_count} deliveries.\',\n
mapping=dict(delivery_count=delivery_count))))\n
</string> </value>
</item>
<item>
......@@ -148,7 +152,7 @@ return context.Base_redirect(form_id, keep_items=dict(\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>uids=[], listbox_uid=[],form_id=\'view\',destination_section=None,portal_type=None,site_suggestion=None,source=None,source_section=None,start_date=None,quantity=None,stop_date=None,title=\'\',**kw</string> </value>
<value> <string>form_id=\'view\', title=\'\', portal_type=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -168,24 +172,15 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>12</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>uids</string>
<string>listbox_uid</string>
<string>form_id</string>
<string>destination_section</string>
<string>portal_type</string>
<string>site_suggestion</string>
<string>source</string>
<string>source_section</string>
<string>start_date</string>
<string>quantity</string>
<string>stop_date</string>
<string>title</string>
<string>portal_type</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
......@@ -217,7 +212,11 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<string>str</string>
<string>_apply_</string>
<string>_getitem_</string>
<string>len</string>
<string>delivery_count</string>
<string>source_section</string>
<string>pl_value</string>
<string>source</string>
<string>resource</string>
<string>pl_line_dict</string>
<string>pl_line_value</string>
......@@ -240,18 +239,9 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<list/>
<list/>
<string>view</string>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<string></string>
<none/>
</tuple>
</value>
</item>
......
......@@ -96,19 +96,15 @@
<key> <string>left</string> </key>
<value>
<list>
<string>your_reference</string>
<string>your_title</string>
<string>your_portal_type</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>your_portal_type</string>
<string>your_start_date</string>
<string>your_stop_date</string>
</list>
<list/>
</value>
</item>
</dictionary>
......@@ -148,7 +144,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>ItemModule_viewDeliveryLineCreationDialog</string> </value>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
......
<?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>
<string>hidden</string>
</list>
</value>
</item>
<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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Item_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -53,54 +53,51 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Check data validity\n
from Products.ERP5Type.Message import translateString\n
<value> <string>from Products.ERP5Type.Message import translateString\n
\n
source = context.Item_getCurrentSiteValue()\n
source_section = context.Item_getCurrentOwnerValue()\n
\n
property_dict = {\'title\':title, \n
\'stop_date\' : stop_date,\n
\'start_date\' : start_date,\n
\'portal_type\' : portal_type, }\n
\n
module = context.getDefaultModule(portal_type=portal_type)\n
line_portal_type = \'%s Line\' % portal_type\n
cell_portal_type = \'%s Cell\' % portal_type\n
\n
pl_dict = {}\n
for k,v in property_dict.items():\n
pl_dict[k]=v\n
\n
pl_line_dict = {}\n
pl_line_dict[\'portal_type\'] = line_portal_type\n
delivery = module.newContent(title=title,\n
source_value=source,\n
source_section_value=source_section,\n
portal_type=portal_type)\n
\n
delivery_line = delivery.newContent(\n
portal_type=line_portal_type,\n
title=context.getReference(),\n
quantity_unit=context.getQuantityUnit(),\n
resource_value=context.Item_getResourceValue())\n
\n
pl_line_dict[\'title\']= \'%s\' % (context.getReference())\n
#pl_line_dict[\'aggregate_value_list\'] = [context]\n
pl_line_dict[\'quantity\'] = quantity\n
pl_line_dict[\'quantity_unit\'] = quantity_unit\n
pl_value = module.newContent(**pl_dict)\n
\n
pl_line_value = pl_value.newContent(**pl_line_dict)\n
pl_line_value.setResourceValue(context.Item_getResourceValue())\n
variation_category_list = context.Item_getVariationCategoryList()\n
\n
if not variation_category_list:\n
pl_line_value.setAggregateValue(context)\n
delivery_line.edit(\n
price=context.getPrice(),\n
quantity=context.getQuantity(),\n
aggregate_value=context)\n
else:\n
pl_line_value.setVariationCategoryList(variation_category_list)\n
delivery_line.setVariationCategoryList(variation_category_list)\n
base_id = \'movement\'\n
cell_key_list = list(pl_line_value.getCellKeyList(base_id=base_id))\n
cell_key_list = list(delivery_line.getCellKeyList(base_id=base_id))\n
cell_key_list.sort()\n
for cell_key in cell_key_list: \n
cell = pl_line_value.newCell(base_id=base_id, \\\n
portal_type=cell_portal_type,*cell_key)\n
for cell_key in cell_key_list:\n
cell = delivery_line.newCell(base_id=base_id,\n
portal_type=cell_portal_type,\n
*cell_key)\n
cell.edit(mapped_value_property_list=[\'price\',\'quantity\'],\n
price=context.getPrice(), quantity=context.getQuantity(),\n
predicate_category_list=cell_key,\n
variation_category_list=cell_key)\n
cell.setAggregateValue(context)\n
price=context.getPrice(),\n
quantity=context.getQuantity(),\n
predicate_category_list=cell_key,\n
variation_category_list=cell_key,\n
aggregate_value=context)\n
\n
return context.Base_redirect(form_id, keep_items=dict(\n
portal_status_message=translateString(\'Item affected\')))\n
return delivery.Base_redirect(\'view\', keep_items=dict(\n
portal_status_message=translateString(\'Item affected\')))\n
</string> </value>
</item>
<item>
......@@ -111,7 +108,7 @@ return context.Base_redirect(form_id, keep_items=dict(\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id=\'view\',destination_section=None,portal_type=None,site_suggestion=None,start_date=None,quantity=None,start_date=None,stop_date=None,title=\'\',quantity_unit=None,**kw</string> </value>
<value> <string>form_id=\'view\', title=\'\', portal_type=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -131,22 +128,15 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>10</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>form_id</string>
<string>destination_section</string>
<string>portal_type</string>
<string>site_suggestion</string>
<string>start_date</string>
<string>quantity</string>
<string>start_date</string>
<string>stop_date</string>
<string>title</string>
<string>quantity_unit</string>
<string>portal_type</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
......@@ -154,24 +144,18 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<string>context</string>
<string>source</string>
<string>source_section</string>
<string>property_dict</string>
<string>module</string>
<string>line_portal_type</string>
<string>cell_portal_type</string>
<string>pl_dict</string>
<string>_getiter_</string>
<string>k</string>
<string>v</string>
<string>_write_</string>
<string>pl_line_dict</string>
<string>_apply_</string>
<string>pl_value</string>
<string>pl_line_value</string>
<string>delivery</string>
<string>delivery_line</string>
<string>variation_category_list</string>
<string>base_id</string>
<string>list</string>
<string>cell_key_list</string>
<string>_getiter_</string>
<string>cell_key</string>
<string>_apply_</string>
<string>cell</string>
<string>dict</string>
</tuple>
......@@ -187,13 +171,6 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<value>
<tuple>
<string>view</string>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<string></string>
<none/>
</tuple>
......
......@@ -66,7 +66,6 @@
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
......@@ -86,20 +85,12 @@
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>my_reference</string>
<string>my_resource</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_title</string>
<string>your_portal_type</string>
</list>
</value>
</item>
......@@ -109,7 +100,6 @@
<list>
<string>my_quantity</string>
<string>my_quantity_unit</string>
<string>your_portal_type</string>
</list>
</value>
</item>
......@@ -150,7 +140,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>Item_viewDeliveryLineCreationDialog</string> </value>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -13,7 +13,6 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>editable</string>
</list>
</value>
......@@ -56,12 +55,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
......@@ -85,10 +78,6 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
......@@ -111,20 +100,4 @@
</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>here/getQuantityUnit</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>my_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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Item_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>my_resource</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>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_resource</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Item_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,9 +12,7 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>required</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -82,10 +80,6 @@
<key> <string>form_id</string> </key>
<value> <string>Item_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
......
......@@ -87,11 +87,11 @@
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
......@@ -109,7 +109,7 @@
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<key> <string>title</string> </key>
<value> <string>Current Owner</string> </value>
</item>
</dictionary>
......
......@@ -84,7 +84,7 @@
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<key> <string>hidden</string> </key>
<value> <int>1</int> </value>
</item>
<item>
......@@ -92,7 +92,7 @@
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<key> <string>title</string> </key>
<value> <string>Reference</string> </value>
</item>
</dictionary>
......
......@@ -9,12 +9,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>delegated_list</string> </key>
<value>
......
......@@ -9,12 +9,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_resource</string> </value>
......@@ -258,7 +252,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>-</string> </value>
<value> <string>Product or Service</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
......
93
\ No newline at end of file
94
\ 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