Commit 6b6cec60 authored by Mame Coumba Sall's avatar Mame Coumba Sall

2009-06-16 mame

*modified so that reference of item is always of form EAN-13 code

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27621 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1dcdea10
......@@ -56,10 +56,11 @@
<value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.Message import translateString\n
from DateTime import DateTime\n
item_list = []\n
request = context.REQUEST\n
total_quantity = 0.0\n
\n
now = DateTime().strftime(\'%d%m%y\')\n
item_portal_type = request[\'type\']\n
\n
if context.getPortalType()==\'Purchase Packing List Line\':\n
......@@ -93,7 +94,7 @@ for line in kw.get(\'listbox\'):\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
reference ="1%s%s" % (now, line["reference"].zfill(6)),\n
quantity=line[\'quantity\'],\n
quantity_unit=context.getQuantityUnit(),\n
**item_property_dict)\n
......@@ -201,11 +202,13 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
<string>DateTime</string>
<string>item_list</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>total_quantity</string>
<string>now</string>
<string>_getitem_</string>
<string>item_portal_type</string>
<string>cell_portal_type</string>
......
......@@ -13,6 +13,7 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>display_maxwidth</string>
<string>display_width</string>
<string>external_validator</string>
<string>title</string>
......@@ -84,6 +85,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <int>6</int> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
......
......@@ -12,7 +12,9 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
<list>
<string>display_maxwidth</string>
</list>
</value>
</item>
<item>
......@@ -72,6 +74,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <int>13</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_reference</string> </value>
......
169
\ No newline at end of file
171
\ 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