Odoo Help

Welcome!

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.

0

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

By
labsdcjkbcdjks
on 6/12/15, 10:19 PM 417 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. 

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

1 follower(s)

Stats

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