Odoo Help


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

Ethan Furman
on 11/13/13, 8:05 PM 1,070 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

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


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