[IMP] introducing new file type: html
authorFabien Pinckaers <fp@openerp.com>
Sat, 4 Aug 2012 14:36:43 +0000 (16:36 +0200)
committerFabien Pinckaers <fp@openerp.com>
Sat, 4 Aug 2012 14:36:43 +0000 (16:36 +0200)
bzr revid: fp@openerp.com-20120804143643-e0331dgtkbxejfmy

openerp/addons/base/res/res_partner_view.xml
openerp/tools/convert.py

index 2f2bff9..ac1a5cd 100644 (file)
             <field name="view_mode">kanban,tree,form</field>
             <field name="context">{"search_default_customer":1}</field>
             <field name="search_view_id" ref="view_res_partner_filter"/>
-            <field name="help" type="xml">
+            <field name="help" type="html">
               <p>
                 Click to add a contact in your address book.
               </p><p>
             <field name="domain">[('customer','=',1)]</field>
             <field name="context">{'default_customer':1, 'search_default_customer':1}</field>
             <field name="filter" eval="True"/>
-            <field name="help" type="xml">
+            <field name="help" type="html">
               <p>
                 Click to add a contact in your address book.
               </p><p>
             <field name="view_mode">kanban,tree,form</field>
             <field name="context">{'search_default_supplier': 1,'default_customer': 0,'default_supplier': 1}</field>
             <field name="filter" eval="True"/>
-            <field name="help" type="xml">
+            <field name="help" type="html">
               <p>
                 Click to add a contact in your address book.
               </p><p>
index c2c610c..e91cce8 100644 (file)
@@ -142,18 +142,20 @@ def _eval_xml(self, node, pool, cr, uid, idref, context=None):
             except Exception:
                 _logger.warning('could not eval(%s) for %s in %s' % (a_eval, node.get('name'), context), exc_info=True)
                 return ""
+        def _process(s, idref):
+            m = re.findall('[^%]%\((.*?)\)[ds]', s)
+            for id in m:
+                if not id in idref:
+                    idref[id]=self.id_get(cr, id)
+            return s % idref
         if t == 'xml':
-            def _process(s, idref):
-                m = re.findall('[^%]%\((.*?)\)[ds]', s)
-                for id in m:
-                    if not id in idref:
-                        idref[id]=self.id_get(cr, id)
-                return s % idref
             _fix_multiple_roots(node)
             return '<?xml version="1.0"?>\n'\
                 +_process("".join([etree.tostring(n, encoding='utf-8')
-                                   for n in node]),
-                          idref)
+                                   for n in node]), idref)
+        if t == 'html':
+            return _process("".join([etree.tostring(n, encoding='utf-8')
+                                   for n in node]), idref)
         if t in ('char', 'int', 'float'):
             d = node.text
             if t == 'int':