def create_rml(self, cr, xml, uid, context=None):
if not context:
context={}
- service = netsvc.LocalService("object_proxy")
+ pool = pooler.get_pool(cr.dbname)
+ ir_translation_obj = pool.get('ir.translation')
# In some case we might not use xsl ...
if not self.xsl:
def translate(doc, lang):
for node in doc.xpath('//*[@t]'):
- translation = service.execute(
- cr.dbname, uid, 'ir.translation', '_get_source',
- self.name2, 'xsl', lang, node.text)
+ translation = ir_translation_obj._get_source(cr, uid, self.name2, 'xsl', lang, node.text)
if translation:
node.text = translation