[IMP] integreated the web serivce for the translations
authorJigar Amin - OpenERP <jam@tinyerp.com>
Fri, 13 Jul 2012 11:42:08 +0000 (17:12 +0530)
committerJigar Amin - OpenERP <jam@tinyerp.com>
Fri, 13 Jul 2012 11:42:08 +0000 (17:12 +0530)
bzr revid: jam@tinyerp.com-20120713114208-yndy8hus850bh97z

1  2 
openerp/service/web_services.py
openerp/tools/translate.py

@@@ -777,6 -777,28 +777,27 @@@ class report_spool(netsvc.ExportService
          else:
              raise Exception, 'ReportNotFound'
  
+ class translation(netsvc.ExportService):
+     def __init__(self, name="translation"):
+         netsvc.ExportService.__init__(self, name)
+     
+     def exp_load(self, db, modules, langs, flag=None, context=None):
+         cr = pooler.get_db(db).cursor()
+         translated_data = pooler.get_pool(db).get('ir.translation').load(cr, modules, langs, flag, context=context)
+         cr.commit()
+         cr.close()
+         return translated_data
+     
+     def dispatch(self, method, params):
+         if method in ['load']:
+             # No security check for these methods
+             pass
+         else:
+             raise KeyError("Method not found: %s" % method)
+         fn = getattr(self, 'exp_'+method)
+         return fn(*params)
 -translation()
  
  def start_web_services():
      db()
Simple merge