[IMP] lxml doc recommends using .get/.set/.keys/.values/.items for attributes manipul...
authorXavier Morel <xmo@openerp.com>
Fri, 9 Aug 2013 13:51:41 +0000 (15:51 +0200)
committerXavier Morel <xmo@openerp.com>
Fri, 9 Aug 2013 13:51:41 +0000 (15:51 +0200)
bzr revid: xmo@openerp.com-20130809135141-114l6262wdts0i43

openerp/tools/convert.py

index 13a0f1a..6c776dc 100644 (file)
@@ -846,7 +846,7 @@ form: module.record_id""" % (xml_id,)
         if '.' in tpl_id:
             module, tpl_id = tpl_id.split('.', 1)
         # set the full template name for qweb <module>.<id>
-        el.attrib['t-name'] = '%s.%s' % (module, tpl_id)
+        el.set('t-name', '%s.%s' % (module, tpl_id))
         el.attrib.pop('id', None)
         el.tag = 't'
 
@@ -855,7 +855,7 @@ form: module.record_id""" % (xml_id,)
             'model': 'ir.ui.view',
         }
         for att in ['forcecreate', 'context']:
-            if att in el.attrib:
+            if att in el.keys():
                 record_attrs[att] = el.attrib.pop(att)
 
         record = etree.Element('record', attrib=record_attrs)