title: Odoo XML RPC search and insert
body: <p>I want to search for customers in res.partner from xl using their names then if yes i assign their partner id in the sales order im creating in xmlrpc else insert that partner and use his id in the sales order im creating.note that the purpose is to migrate sales order from xls file to odoo,for now the actual code is the following.</p>
  
  <pre><code>import psycopg2
  import psycopg2.extras
  import pyexcel_xls
  import pyexcel as pe
  from pyexcel_xls import get_data
  from datetime import datetime
  import xmlrpclib
  import json
  
  url = 'http://localhost:8070'
  db = 'Docker'
  username = 'admin'
  password = 'odoo'
  #data = get_data("salesorder.xls")
  #print(json.dumps(data))
  records = pe.get_records(file_name="salesorder.xls")
  for record in records:
      print record['name']
      names = record['name']
      print record['location']
      print record['zip']
      print record['republic']
      dates = record['date']
      print dates
      print datetime.strptime(dates,'%d/%M/%Y')
      lastdat=datetime.strptime(dates,'%d/%M/%Y')
  
  
      common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
      output = common.version()
      models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
      ids = models.execute_kw(db, uid, password,
                              'res.partner', 'search',
                              ['name', '=', "names"])
  
  
  
      uid = common.authenticate(db, username, password, {})
      print output
      models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
      id = models.execute_kw(db, uid, password, 'sale.order', 'create',     [{
          'name': names,
          'validity_date':"2016-01-18"
          #'payment_term_id':"1"
          # 'user_id':"1"
          # 'state':"sale"
  
      }])
      print id
  </code></pre>