[Erp5-report] r20711 - in /erp5/trunk/bt5/erp5_trade: SkinTemplateItem/portal_skins/erp5_tr...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 21 15:52:45 CEST 2008


Author: nicolas
Date: Mon Apr 21 15:52:42 2008
New Revision: 20711

URL: http://svn.erp5.org?rev=20711&view=rev
Log:
Convert Strings in unicode

Modified:
    erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_getODTDataDict.xml
    erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingList_getODTDataDict.xml
    erp5/trunk/bt5/erp5_trade/bt/revision

Modified: erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_getODTDataDict.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_getODTDataDict.xml?rev=20711&r1=20710&r2=20711&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_getODTDataDict.xml (original)
+++ erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_getODTDataDict.xml Mon Apr 21 15:52:42 2008
@@ -154,6 +154,13 @@
     sub_list.append(x)\n
     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
 \n
 for line in getSubLineList(context):\n
   prod_desc = line.getResource() is not None and line.getResourceValue().getDescription() or \'\'\n
@@ -190,7 +197,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
@@ -202,13 +209,13 @@
   \'source_section_email\': getEmail(context.getSourceSection() and context.getSourceSectionValue().getEmailText() or \'\'),\n
 \n
   \'source_decision_title\': context.getSourceDecisionTitle() or \'\',\n
-  \'source_decision_address\': unicode(getOneLineAddress(\n
+  \'source_decision_address\':getOneLineAddress(\n
       context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressText() or \'\',\n
-      context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressRegionTitle() or \'\'), \'utf8\'),\n
+      context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressRegionTitle() or \'\'),\n
   \'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
@@ -218,16 +225,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
+  \'destination_section_address\': 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
+      context.getDestinationSection() and context.getDestinationSectionValue().getDefaultAddressRegionTitle() or \'\'),\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
@@ -249,7 +256,7 @@
   \'line_list\': line_list,\n
 }\n
 \n
-return data_dict\n
+return unicodeDict(data_dict)\n
 </string> </value>
         </item>
         <item>
@@ -316,6 +323,7 @@
                             <string>total_price</string>
                             <string>total_vat</string>
                             <string>getSubLineList</string>
+                            <string>unicodeDict</string>
                             <string>_getiter_</string>
                             <string>line</string>
                             <string>None</string>
@@ -323,7 +331,6 @@
                             <string>desc</string>
                             <string>line_dict</string>
                             <string>_inplacevar_</string>
-                            <string>unicode</string>
                             <string>data_dict</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingList_getODTDataDict.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingList_getODTDataDict.xml?rev=20711&r1=20710&r2=20711&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingList_getODTDataDict.xml (original)
+++ erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingList_getODTDataDict.xml Mon Apr 21 15:52:42 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
@@ -173,26 +179,26 @@
     \'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
-  \'source_section_address\': unicode(getOneLineAddress(\n
+  \'source_section_address\': getOneLineAddress(\n
       context.getSourceSection() and context.getSourceSectionValue().getDefaultAddressText() or \'\',\n
-      context.getSourceSection() and context.getSourceSectionValue().getDefaultAddressRegionTitle() or \'\'), \'utf8\'),\n
+      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\': getEmail(context.getSourceSection() and context.getSourceSectionValue().getEmailText() or \'\'),\n
-  \'source_section_vatid\': unicode(getVatId(context.getSourceSection() and context.getSourceSectionValue().getVatCode() or \'\'), \'utf8\'),\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
+  \'source_decision_address\': getOneLineAddress(\n
       context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressText() or \'\',\n
-      context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressRegionTitle() or \'\'), \'utf8\'),\n
+      context.getSourceDecision() and context.getSourceDecisionValue().getDefaultAddressRegionTitle() or \'\'),\n
   \'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
@@ -202,16 +208,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
+  \'destination_section_address\': 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
+      context.getDestinationSection() and context.getDestinationSectionValue().getDefaultAddressRegionTitle() or \'\'),\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 @@
   \'line_list\': line_list,\n
 }\n
 \n
-return data_dict\n
+return unicodeDict(data_dict)\n
 </string> </value>
         </item>
         <item>
@@ -300,6 +306,7 @@
                             <string>total_price</string>
                             <string>total_vat</string>
                             <string>getSubLineList</string>
+                            <string>unicodeDict</string>
                             <string>_getiter_</string>
                             <string>line</string>
                             <string>None</string>
@@ -307,7 +314,6 @@
                             <string>desc</string>
                             <string>line_dict</string>
                             <string>_inplacevar_</string>
-                            <string>unicode</string>
                             <string>data_dict</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/bt5/erp5_trade/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/bt/revision?rev=20711&r1=20710&r2=20711&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/bt/revision (original)
+++ erp5/trunk/bt5/erp5_trade/bt/revision Mon Apr 21 15:52:42 2008
@@ -1,1 +1,1 @@
-331
+332




More information about the Erp5-report mailing list