Odoo Help


Get the value of order_id in the function product_id_change

on 1/13/14, 4:56 PM 1,275 views

Hi everybody,

I would like to know if is it possible to get the value of the current order_id in the function product_id_change. Need I to modify the parameters of the function and send the value of my order_id? Is it possible to get this value directly into the function?

Thanks a lot,



Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Odoo Developer

Grover Menacho
On 1/13/14, 5:01 PM

It depends, as you can see on product_id_change you have ids as a parameter, if you have that parameter you can get the order_id of that order_line. But, if you are creating a new order and you call product_id_change you don't have order_id because this doesn't exist on the database. In order to get the order_id you have to save your order.

On 1/13/14, 5:19 PM

Hi Grover,

Thank you for your answer. So if the product has already saved i can use ids.order_id yes?


Yes. Well you have to do: for line in self.browse(cr, uid, ids): line.order_id.id Then you'll have the id of your order

GH Mediacloud, Grover Menacho
on 1/13/14, 8:38 PM

Hi Grover. Really strange because my line.order_id.id is always = 0. Have an idea? Thanks again

on 1/14/14, 5:10 AM

0? Really strange... are you sure that your documents is saved?

GH Mediacloud, Grover Menacho
on 1/14/14, 12:25 PM

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.


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)


Asked: 1/13/14, 4:56 PM
Seen: 1275 times
Last updated: 3/16/15, 8:10 AM