あるデータベースから別のデータベースにデータをインポートするスクリプトを作成できます。
import xmlrpclib
from osv import osv, fields
#To create connection to the database from where you want to import data
def connect_server(self, cr, uid, ids, context=None):
sock_common = xmlrpclib.ServerProxy ('http://localhost:8070/xmlrpc/common', encoding="UTF-8")
remote_uid = sock_common.login(database_name, user_name, password)
sock = xmlrpclib.ServerProxy('http://localhost:8070/xmlrpc/object', encoding="UTF-8")
return (sock, remote_uid)
#Fetch data from another database
def get_data(cr, uid, ids, context=None):
sock, remote_uid = self.connect_server(cr, uid, ids, context=context)
pos_order_obj = self.pool.get('pos.order')
pos_order_ids = sock.execute(db_name, remote_uid, password, pos_order_obj._name, 'search', [])
for pos in in sock.execute(db_name, remote_uid, password, pos_order_obj._name, 'read', pos_order_ids, []):
#fetch the data and create record in your current database.
new_pos_val = {'name': pos['name'],}
pos_order_obj.create(cr, uid, new_pos_val, context=context)
return True
それがあなたの問題を解決することを願っています。