[Erp5-report] r41888 nicolas - in /erp5/trunk/bt5/erp5_item: SkinTemplateItem/portal_skins/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Dec 30 18:02:24 CET 2010
Author: nicolas
Date: Thu Dec 30 18:02:23 2010
New Revision: 41888
URL: http://svn.erp5.org?rev=41888&view=rev
Log:
* retrieve list of cells with getCellValueList
* reference must not be mandatory
* transition workflow must be automatic if executed right after creation of Item
Modified:
erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item_trade/DeliveryLine_createItemList.xml
erp5/trunk/bt5/erp5_item/bt/revision
Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item_trade/DeliveryLine_createItemList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item_trade/DeliveryLine_createItemList.xml?rev=41888&r1=41887&r2=41888&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item_trade/DeliveryLine_createItemList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item_trade/DeliveryLine_createItemList.xml [utf8] Thu Dec 30 18:02:23 2010
@@ -60,17 +60,6 @@ total_quantity = 0.0\n
\n
item_portal_type = kw.get(\'type\')\n
\n
-if context.getPortalType()==\'Purchase Packing List Line\':\n
- cell_portal_type = \'Purchase Packing List Cell\'\n
-elif context.getPortalType()==\'Purchase Order Line\' :\n
- cell_portal_type = \'Purchase Order Cell\'\n
-elif context.getPortalType()==\'Sale Packing List Line\':\n
- cell_portal_type = \'Sale Packing List Cell\'\n
-elif context.getPortalType()== \'Internal Packing List Line\':\n
- cell_portal_type = \'Internal Packing List Cell\'\n
-elif context.getPortalType()== \'Inventory Line\':\n
- cell_portal_type = \'Inventory Cell\'\n
-\n
item_property_dict = dict()\n
\n
# if the formbox for extra item properties is enabled, use it.\n
@@ -84,29 +73,30 @@ if dialog.has_field(\'your_item_extra_pr
item_property_dict[field_id.replace(\'your_\', \'\', 1)] =\\\n
request.get(field_id)\n
\n
-movement_cell_list = context.contentValues(portal_type=cell_portal_type)\n
+movement_cell_list = context.getCellValueList()\n
base_id = \'movement\'\n
\n
for line in kw.get(\'listbox\'):\n
\n
- if line.has_key(\'listbox_key\') and (line[\'reference\'] not in (\'\', None)):\n
- item = context.portal_catalog.getResultValue(\n
- portal_type=item_portal_type,\n
- reference=line[\'reference\'])\n
- if item is not None:\n
- msg = translateString("Reference Defined On Line ${line_id} already exists",\n
+ if line.has_key(\'listbox_key\'):\n
+ item_reference = line.get(\'reference\')\n
+ if item_reference:\n
+ item = context.portal_catalog.getResultValue(\n
+ portal_type=item_portal_type,\n
+ reference=item_reference)\n
+ if item is not None:\n
+ msg = translateString("Reference Defined On Line ${line_id} already exists",\n
mapping={\'line_id\': line[\'listbox_key\']})\n
- return context.Base_redirect(form_id, keep_items=dict(\n
- portal_status_message=msg))\n
+ return context.Base_redirect(form_id,\n
+ keep_items=dict(portal_status_message=msg))\n
else:\n
module = context.getDefaultModule(item_portal_type)\n
item = module.newContent(portal_type=item_portal_type,\n
title=line[\'title\'],\n
- reference = line["reference"],\n
- quantity=line[\'quantity\'],\n
+ reference=item_reference,\n
+ quantity=line.get(\'quantity\'),\n
quantity_unit=context.getQuantityUnit(),\n
**item_property_dict)\n
- item.validate()\n
\n
line_variation_category_list = []\n
for variation in (\n
Modified: erp5/trunk/bt5/erp5_item/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/bt/revision?rev=41888&r1=41887&r2=41888&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/bt/revision [utf8] Thu Dec 30 18:02:23 2010
@@ -1 +1 @@
-274
\ No newline at end of file
+276
\ No newline at end of file
More information about the Erp5-report
mailing list