[Erp5-report] r20710 - in /erp5/trunk/bt5/erp5_invoicing: SkinTemplateItem/portal_skins/erp...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 21 15:44:38 CEST 2008
Author: nicolas
Date: Mon Apr 21 15:44:34 2008
New Revision: 20710
URL: http://svn.erp5.org?rev=20710&view=rev
Log:
Convert all strings in unicode
Modified:
erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_getODTDataDict.xml
erp5/trunk/bt5/erp5_invoicing/bt/revision
Modified: erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_getODTDataDict.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_getODTDataDict.xml?rev=20710&r1=20709&r2=20710&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_getODTDataDict.xml (original)
+++ erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_getODTDataDict.xml Mon Apr 21 15:44:34 2008
@@ -155,6 +155,12 @@
sub_list.extend(getSubLineList(x))\n
return sub_list\n
\n
+def unicodeDict(d):\n
+ for k, v in d.items():\n
+ if isinstance(v, str):\n
+ d.update({k:unicode(v, \'utf8\')})\n
+ return d\n
+\n
for line in getSubLineList(context):\n
prod_desc = line.getResource() is not None and line.getResourceValue().getDescription() or \'\'\n
desc = getProductAndLineDesc(prod_desc, line.getDescription())\n
@@ -174,7 +180,7 @@
\'total_price\': line.getTotalPrice() or \'\',\n
}\n
total_price += line.getTotalPrice() or 0.0\n
- line_list.append(line_dict.copy())\n
+ line_list.append(unicodeDict(line_dict.copy()))\n
\n
data_dict = {\n
\'source_section_title\': context.getSourceSectionTitle() or \'\',\n
@@ -183,8 +189,8 @@
context.getSourceSection() and context.getSourceSectionValue().getDefaultAddressRegionTitle() or \'\'),\n
\'source_section_telfax\': getPhoneAndFax(context.getSourceSection() and context.getSourceSectionValue().getTelephoneText() or \'\',\n
context.getSourceSection() and context.getSourceSectionValue().getFaxText() or \'\'),\n
- \'source_section_email\': unicode(getEmail(context.getSourceSection() and context.getSourceSectionValue().getEmailText() or \'\'), \'utf8\'),\n
- \'source_section_vatid\': unicode(getVatId(context.getSourceSection() and context.getSourceSectionValue().getVatCode() or \'\'), \'utf8\'),\n
+ \'source_section_email\': getEmail(context.getSourceSection() and context.getSourceSectionValue().getEmailText() or \'\'),\n
+ \'source_section_vatid\': getVatId(context.getSourceSection() and context.getSourceSectionValue().getVatCode() or \'\'),\n
\n
\'source_decision_title\': context.getSourceDecisionTitle() or \'\',\n
\'source_decision_address\': unicode(getOneLineAddress(\n
@@ -193,7 +199,7 @@
\'source_decision_telfax\': getPhoneAndFax(context.getSourceDecision() and context.getSourceDecisionValue().getTelephoneText() or \'\',\n
context.getSourceDecision() and context.getSourceDecisionValue().getFaxText() or \'\'),\n
\'source_decision_email\': getEmail(context.getSourceDecision() and context.getSourceDecisionValue().getEmailText() or \'\'),\n
- \'source_decision_vatid\': unicode(getVatId(context.getSourceDecision() and context.getSourceDecisionValue().getVatCode() or \'\'), \'utf8\'),\n
+ \'source_decision_vatid\': getVatId(context.getSourceDecision() and context.getSourceDecisionValue().getVatCode() or \'\'),\n
\n
\'destination_title\': context.getDestinationTitle() or \'\',\n
\'destination_address\': getOneLineAddress(\n
@@ -203,16 +209,16 @@
context.getDestination() and context.getDestinationValue().getFaxText() or \'\'),\n
\'destination_email\': getEmail(context.getDestination() and context.getDestinationValue().getEmailText() or \'\'),\n
\n
- \'destination_section_title\': unicode(context.getDestinationSectionTitle() or \'\', \'utf8\'),\n
+ \'destination_section_title\': context.getDestinationSectionTitle() or \'\',\n
\'destination_section_image_path\': context.getDestinationSectionValue() is not None and context.getDestinationSectionValue().getDefaultImagePath() or \'\',\n
\'destination_section_address\': unicode(getOneLineAddress(\n
context.getDestinationSection() and context.getDestinationSectionValue().getDefaultAddressText() or \'\',\n
context.getDestinationSection() and context.getDestinationSectionValue().getDefaultAddressRegionTitle() or \'\'), \'utf8\'),\n
- \'destination_section_telfax\': unicode(getPhoneAndFax(\n
+ \'destination_section_telfax\': getPhoneAndFax(\n
context.getDestinationSection() and context.getDestinationSectionValue().getTelephoneText() or \'\',\n
- context.getDestinationSection() and context.getDestinationSectionValue().getTelephoneText() or \'\'), \'utf8\'),\n
- \'destination_section_email\': unicode(getEmail(context.getDestinationSection() and context.getDestinationSectionValue().getEmailText() or \'\'), \'utf8\'),\n
- \'destination_section_vatid\': unicode(getVatId(context.getDestinationSection() and context.getDestinationSectionValue().getVatCode() or \'\'), \'utf8\'),\n
+ context.getDestinationSection() and context.getDestinationSectionValue().getTelephoneText() or \'\'),\n
+ \'destination_section_email\': getEmail(context.getDestinationSection() and context.getDestinationSectionValue().getEmailText() or \'\'),\n
+ \'destination_section_vatid\': getVatId(context.getDestinationSection() and context.getDestinationSectionValue().getVatCode() or \'\'),\n
\n
\'destination_decision_title\': context.getDestinationDecisionTitle() or \'\',\n
\'destination_decision_telfax\': getPhoneAndFax(context.getDestinationDecision() and context.getDestinationDecisionValue().getTelephoneText() or \'\',\n
@@ -233,7 +239,7 @@
\n
\'line_list\': line_list,\n
}\n
-\n
+unicodeDict(data_dict)\n
#from pprint import pformat\n
#context.log(pformat(data_dict))\n
return data_dict\n
@@ -304,6 +310,7 @@
<string>total_vat</string>
<string>excluded_portal_type_list</string>
<string>getSubLineList</string>
+ <string>unicodeDict</string>
<string>_getiter_</string>
<string>line</string>
<string>None</string>
Modified: erp5/trunk/bt5/erp5_invoicing/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_invoicing/bt/revision?rev=20710&r1=20709&r2=20710&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_invoicing/bt/revision (original)
+++ erp5/trunk/bt5/erp5_invoicing/bt/revision Mon Apr 21 15:44:34 2008
@@ -1,1 +1,1 @@
-76
+77
More information about the Erp5-report
mailing list