Commit bc1736fa authored by Rafael Monnerat's avatar Rafael Monnerat

Improved Order/Delivery creation Fast Input

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21322 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d011a725
......@@ -64,7 +64,7 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -87,7 +87,7 @@
<value> <string>Item_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<key> <string>items</string> </key>
<value>
<list/>
</value>
......
......@@ -64,7 +64,7 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -87,7 +87,7 @@
<value> <string>Item_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<key> <string>items</string> </key>
<value>
<list/>
</value>
......
......@@ -83,7 +83,7 @@
<value> <string>Item_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
......
......@@ -12,7 +12,9 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
<list>
<string>required</string>
</list>
</value>
</item>
<item>
......@@ -86,6 +88,10 @@
<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>
......
......@@ -52,6 +52,16 @@
<key> <string>action</string> </key>
<value> <string>Item_createRelatedAffectationValidate</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
......@@ -96,10 +106,7 @@
<value>
<list>
<string>my_reference</string>
<string>my_quantity_unit</string>
<string>my_resource</string>
<string>your_source</string>
<string>your_source_section</string>
</list>
</value>
</item>
......@@ -118,6 +125,7 @@
<value>
<list>
<string>my_quantity</string>
<string>my_quantity_unit</string>
<string>your_portal_type</string>
</list>
</value>
......@@ -159,7 +167,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>Item_createRelatedAffectationUpdate</string> </value>
<value> <string>Item_createAffectationFormDialog</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>default</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_source</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>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>
<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>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_source</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>
<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: here.Item_getCurrentSiteValue() is not None and here.Item_getCurrentSiteValue().getRelativeUrl()</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>your_source_section</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_source_section</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="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>from Products.ERP5Type.Document import newTempBase\n
#keyword to create new packing_list_line\n
\n
request = context.REQUEST\n
\n
global error_count\n
error_count = 0\n
\n
site_query = site_suggestion\n
#context.log(\'destination\',destination)\n
if destination not in (None,\'\'):\n
error_count+=1\n
if batch_mode:\n
return error_count\n
context.Base_updateDialogForm(**kw)\n
if portal_type == \'Sale Packing List\':\n
return context.Item_createRelatedSalePackingListFormDialog(destination,destination_section,portal_type,site_suggestion,source,source_section,stop_date,title,**kw)\n
return context.Item_createRelatedAffectationFormDialog(destination,destination_section,portal_type,site_suggestion,source,source_section,stop_date,title,**kw)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>destination=None,destination_section=None,portal_type=None,site_suggestion=None,source=None,source_section=None,stop_date=None,title=\'\',batch_mode=0, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>9</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>destination</string>
<string>destination_section</string>
<string>portal_type</string>
<string>site_suggestion</string>
<string>source</string>
<string>source_section</string>
<string>stop_date</string>
<string>title</string>
<string>batch_mode</string>
<string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>error_count</string>
<string>site_query</string>
<string>None</string>
<string>_inplacevar_</string>
<string>_apply_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<string></string>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Item_createRelatedAffectationUpdate</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -65,29 +65,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# Check data validity\n
error_count = 0\n
#error_count = context.Item_createRelatedAffectationUpdate(destination, destination_section,portal_type,site_suggestion,source,source_section,stop_date,title,batch_mode=1, **kw)\n
#context.log(\'error_count\',error_count)\n
context.log(\'portal_type\',portal_type)\n
if portal_type not in (\'Sale Packing List\'):\n
if error_count > 0:\n
return context.Item_createRelatedAffectationUpdate(destination,\\\n
destination_section, \\\n
portal_type,\\\n
site_suggestion,\\\n
source, \\\n
source_section, \\\n
stop_date,title, \\\n
batch_mode=0, **kw)\n
<value> <string># Check data validity\n
source = context.Item_getCurrentSiteValue()\n
source_section = context.Item_getCurrentOwnerTitle(with_title=0)\n
\n
property_dict = {\'title\':title,\n
\'destination_section\' : destination_section,\n
\'destination\' : destination, \n
\'source_section\' : source_section,\n
\'source\' : source,\n
\'stop_date\' : stop_date,\n
\'start_date\' : start_date,\n
\'portal_type\' : portal_type, }\n
......@@ -96,7 +80,6 @@ module = context.getDefaultModule(portal_type=portal_type)\n
line_portal_type = \'%s Line\' % portal_type\n
\n
pl_dict = {}\n
#context.log(\'property_dict:\',property_dict)\n
for k,v in property_dict.items():\n
pl_dict[k]=v\n
\n
......@@ -109,12 +92,12 @@ pl_line_dict[\'quantity\'] = quantity\n
pl_line_dict[\'quantity_unit\'] = quantity_unit\n
\n
pl_value = module.newContent(**pl_dict)\n
pl_value.setSourceValue(source)\n
pl_value.setSourceSectionValue(source)\n
pl_line_value = pl_value.newContent(**pl_line_dict)\n
\n
context.REQUEST[\'RESPONSE\'].redirect(\'/\'.join(pl_value.getPhysicalPath()))\n
]]></string> </value>
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -136,7 +119,7 @@ context.REQUEST[\'RESPONSE\'].redirect(\'/\'.join(pl_value.getPhysicalPath()))\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>destination=None,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>destination=None,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>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -166,17 +149,17 @@ context.REQUEST[\'RESPONSE\'].redirect(\'/\'.join(pl_value.getPhysicalPath()))\n
<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>start_date</string>
<string>stop_date</string>
<string>title</string>
<string>quantity_unit</string>
<string>kw</string>
<string>error_count</string>
<string>_getattr_</string>
<string>context</string>
<string>_apply_</string>
<string>source</string>
<string>source_section</string>
<string>property_dict</string>
<string>module</string>
<string>line_portal_type</string>
......@@ -186,7 +169,7 @@ context.REQUEST[\'RESPONSE\'].redirect(\'/\'.join(pl_value.getPhysicalPath()))\n
<string>v</string>
<string>_write_</string>
<string>pl_line_dict</string>
<string>quantity_unit</string>
<string>_apply_</string>
<string>pl_value</string>
<string>pl_line_value</string>
<string>_getitem_</string>
......@@ -210,8 +193,8 @@ context.REQUEST[\'RESPONSE\'].redirect(\'/\'.join(pl_value.getPhysicalPath()))\n
<none/>
<none/>
<none/>
<none/>
<string></string>
<none/>
</tuple>
</value>
</item>
......
......@@ -68,7 +68,7 @@
<value> <string>from DateTime import DateTime\n
\n
date = DateTime()\n
last_affectation_list = context.portal_simulation.getTrackingList(item=context.getRelativeUrl(), at_date=date)\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(item=context.getRelativeUrl(), at_date=date)\n
#context.log(\'last_affectation_list\',len(last_affectation_list))\n
if len(last_affectation_list) == 0:\n
return None\n
......
38
\ No newline at end of file
40
\ 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