Commit 3d8c3109 authored by Nicolas Delaby's avatar Nicolas Delaby

* retrieve list of cells with getCellValueList

* reference must not be mandatory
* transition workflow must be automatic if executed right after creation of Item

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41888 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b841199b
......@@ -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_property_list\'):\n
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
......
274
\ No newline at end of file
276
\ 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