def trans_generate(lang, modules, dbname=None): #... def push_translation(module, type, name, id, source): #... def encode(s): #... for (xml_name,model,res_id,module) in cr.fetchall(): module = encode(module) model = encode(model) xml_name = "%s.%s" % (module, encode(xml_name)) if not pool.get(model): logger.notifyChannel("db", netsvc.LOG_ERROR, "unable to find object %r" % (model,)) continue try: ## INSERT TWO LINES if len(pool.get(model).search(cr,uid,[('id','=',res_id)])) == 0: continue ### obj = pool.get(model).browse(cr, uid, res_id) except BrowseRecordError: logger.notifyChannel("db", netsvc.LOG_ERROR, "unable to find object %r with id %d" % (model, res_id)) continue .....