Skip to Content
Menu
This question has been flagged

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. 

Avatar
Discard
Related Posts Replies Views Activity
3
Sep 18
8174
1
Jun 15
2594
2
May 24
367
1
Dec 24
1007
0
May 23
1099