Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: request

by
Wolfgang Pichler
- 11/11/2014 04:11:30
hi,

you cannot specify partner_id with the name as referent - you first have to fetch the real id from the system with a search function.

so do a search on res.partner for the partner - you will get the id

Also you can not specify the product direct with the sale.order - adding products to sale orders means to add sale.order.line entries to an existing sale.order.

so you have to create sale.order - then search the product ids - and create sale.order.line entries.

or use the relational mapping to automatically create the sale.order.line entries with the sale.order line - take a look here at the end to get an idea


br,
Wolfgang

Am 11.11.2014 um 09:57 schrieb Khouaja mohamed aymen <khouaja.aymen@gmail.com>:

thx Mr pichler for ur answer  

below in red color you will find the request i did 

@Grapes(
    @Grab(group='org.codehaus.groovy', module='groovy-xmlrpc', version='0.8')
)         
import groovy.net.xmlrpc.*

//Adresse URL du serveur qui contient OpenERP

//Données d’utilisateur qui permettent l’authentification auprès du serveur  
def username = "admin" //nom d’utilisateur
def pwd = "isicallisto"   //mot de passe
def dbname = "CALLISTO"   //nom de base de donnée du groupe


def serverProxy = new XMLRPCServerProxy(myserver+'common')
def uid = serverProxy.login(dbname, username, pwd)
def openerp =  new XMLRPCServerProxy(myserver+'object')

println("---- Connection Established ----")

/**** First Script Listing All Customers ****/
println()
println("**************** Script 1 ******************")
println()


def mapqot = ['partner_id':"Agrolait",'client_order_ref':"Agrolait",'product_id':"Datacard",'date_order':"2014-11-10",'product_uom_qty':"4"]
def partner_id = openerp.execute(dbname, uid, pwd,'sale.order','create',mapqot) 
 
openerp.execute(dbname, uid, pwd, 'sale.order', 'save',  partner_id[0])


2014-11-11 9:52 GMT+01:00 Wolfgang Pichler <wpichler@callino.at>:

Hi,


you have to show us the request - it seems you have a wrong parameter at the request

br,
Wolfgang

Am 11.11.2014 um 09:42 schrieb Khouaja mohamed aymen <khouaja.aymen@gmail.com>:

Hi , 


im working on openERP 7.0 and im trying to create  an object 'sale.order' in openErp

through an  XML-RPC script launched from the webpage  but i couldn't  when i run 

the script i have this error  in the attached file 


Best regards 

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

<is.txt>

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe