Odoo Help


How to set fields to already existing values on purchase.order when using xmlrpc

on 6/12/15, 10:19 PM 665 views

following this question https://www.odoo.com/fr_FR/forum/help-1/question/how-do-i-create-a-request-for-quotation-on-odoo-v8-using-xmlrpc-86689

I want to know, suppose a field such as 'partner_id',  which is a  many2one type, how would i use an already existing partner? 

at the moment im confused since i would have to look up an existing partner like thus:

vals = models.execute_kw(db, uid, password,
'res.partner', 'read', [6])

and use it when creating using the syntax

models.execute_kw(db, uid, password, 'purchase.order', 'create', [{  ..., 'partner_id': vals  }])

The trouble is that it may also have one2many/many2one/..  type of fields in turn, and i have to do the same for those fields, is this correct? it seems like this will rapidly get out of  hand if there are many  such fields. 

Is it not possible to just enter the 'id' of an existing resource (such as partner_id in this case), in that field?  

Im unable to tell from the docs. 

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

1 follower(s)


Asked: 6/12/15, 10:19 PM
Seen: 665 times
Last updated: 6/12/15, 10:19 PM