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