Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Why does XML-RPC auto create records, when web interface does not?

Ethan Furman
on 11/13/13, 8:05 PM 672 views

I have a table that looks like this:

class fnx_sr_shipping(osv.Model):
    _name = 'fnx.sr.shipping'
    _description = 'shipping & receiving entries'
    _inherits = {
       'res.partner': 'partner_id',
    _order = 'appointment_date desc, appointment_time asc'

    _columns = {

       'partner_id': fields.many2one(

The required=True is required by OpenERP (if it's not there, OE adds it).

When I use the web interface I am able to create a new shipping record and pick existing partners; however, if I try the same thing using XML-RPC (supplying the partner_ids in the shipping record create call) OpenERP tries to create a new record in res.partner using default settings, which of course fails because some required fields have no default (such as the name).

Here's the XML-RPC code I'm using:

import openerplib
OE = PropertyDict()          # allows attribute-style access for keys
OE.conn = openerplib.get_connection(
OE.res_partner = conn.get_model('res.partner')
values['partner_id'] = 77     # or whatever it actually is ;)

I have verified that the ids being passed are correct.

Is this a bug in my code, or in OpenERP?

In case anyone is curious, I worked around the problem by removing the _inherits and using functional fields to get the res.partner fields I was interested in.

SalesInq, Ethan Furman
on 11/13/13, 8:06 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 11/13/13, 8:05 PM
Seen: 672 times
Last updated: 3/16/15, 8:10 AM