Odoo Help


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.


OpenERP - How to get sequence number when creating new Sales Order via XMLRPC

on 3/21/13, 5:35 PM 2,226 views

Hi, I'm making an Android app for OpenERP and I'm trying to create new Sales Order. One of the required fields however is Order Reference, which is normaly generated from the sequence.

Is there some way to get this sequence via xmlrpc?

Or do I have to make my own sequence in the app? ...but then how can I make sure that it would not colide with order references generated via web client?

Thank you.

On 3/22/13, 4:31 AM

Hi there :)

It's really easy. You let 'name' field empty and OpenERP triggers an action and completes it for you.

Python example:

 order = {
   'shop_id': 1,
   'state': 'draft',
   'date_order': '2013-09-01',
   'user_id': 4,
   'partner_id': 7,
   'partner_invoice_id': 1,
   'partner_order_id': 1,
   'partner_shipping_id': 1,
   'picking_policy': 'direct',
   'order_policy': 'manual',
   'pricelist_id': 1,
   'note': 'note',

order_id = sock.execute(dbname, uid, pwd, 'sale.order', 'create', order)

Result: Order reference S0059

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

0 follower(s)


Asked: 3/21/13, 5:35 PM
Seen: 2226 times
Last updated: 3/16/15, 8:10 AM