Commit e31176ca authored by Jérome Perrin's avatar Jérome Perrin

Changes Delivery_getODTDataDict with Thierry and Łukasz:

- revert 22068. Reference is shown on line, but they are sorted by int index
- in the description column, show line's description, resource's description
or resource's title. When this is a variated cell, show variation names

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22211 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ab21ae1
......@@ -66,6 +66,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>T_ = context.Base_translateString\n
request = context.REQUEST\n
\n
def getFieldAsString(field):\n
field = field or \'\'\n
......@@ -137,7 +138,8 @@ def unicodeDict(d):\n
\n
\n
for line in getSubLineList(context):\n
prod_desc = line.getResource() is not None and line.getResourceValue().getDescription() or \'\'\n
prod_desc = line.getResource() is not None and \\\n
line.getResourceValue().getDescription() or line.getResourceTitle()\n
desc = getProductAndLineDesc(prod_desc, line.getDescription())\n
if getattr(line, \'hasLineContent\', None) is not None and line.hasLineContent()\\\n
or getattr(line, \'hasCellContent\', None) is not None and line.hasCellContent():\n
......@@ -157,11 +159,17 @@ for line in getSubLineList(context):\n
\'total_price\': \'\',\n
}\n
else:\n
if line.getPortalType().endswith(\'Cell\'):\n
display_id = \'translated_title\'\n
if request.get(\'international_form\'):\n
display_id = \'title\'\n
desc = \', \'.join([x[0] for x in\n
line.getVariationCategoryItemList(display_id=display_id)])\n
line_dict = {\n
\'style_name\': \'Table_20_Contents\',\n
\'left_style_name\': \'Table_20_Contents_20_Left\',\n
\'right_style_name\': \'Table_20_Contents_20_Right\',\n
\'index\': line.getIntIndex() or line.getReference(),\n
\'index\': line.getReference() or line.getIntIndex(),\n
\'source_reference\': getSourceReference(line),\n
\'reference\': line.getResource() is not None and line.getResourceValue().getReference() or \'\',\n
\'description\': desc,\n
......@@ -274,6 +282,12 @@ return unicodeDict(data_dict)\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>getSourceReference, getSubLineList</string> </value>
......@@ -307,6 +321,7 @@ return unicodeDict(data_dict)\n
<string>_getattr_</string>
<string>context</string>
<string>T_</string>
<string>request</string>
<string>getFieldAsString</string>
<string>getProductAndLineDesc</string>
<string>getOneLineAddress</string>
......@@ -328,6 +343,11 @@ return unicodeDict(data_dict)\n
<string>desc</string>
<string>getattr</string>
<string>line_dict</string>
<string>display_id</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>_getitem_</string>
<string>_inplacevar_</string>
<string>inch_cm_ratio</string>
<string>data_dict</string>
......
407
\ No newline at end of file
408
\ 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