Odoo Help

1

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

By
micromanc3r
on 3/21/13, 5:35 PM 2,809 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.

3
tvazac
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

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.

Register

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

0 follower(s)

Stats

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