I have a basic Python script that uses the xmlrpclib library to remotely create a customer in OpenERP 7.0.
customer = { 'comment': 'test notes', 'street2': None, 'phone': '605-730-1580', 'street': '24246 450th Ave', 'city': 'Pukwana', 'name': 'Karla Burns', 'zip': '57373', 'country': 'United States', 'Company': None, 'email': 'email@gmail.com', 'Active': 'TRUE', 'res.country.state': 'South Dakota', 'is_company': 'TRUE' } customer_id = sock.execute(dbname, uid, pwd, 'res.partner', 'create', customer)
The code runs fine and it creates the record but I can't get the State or Country to show up. The customer form is looking for res.partner.state_id and res.partner.country_id but those are integer fields and I don't know the int value for each state. How do I lookup the int of a state from res.country.state and feed it to res.partner.state_id?