Odoo Help

Welcome!

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.

0

Get the value of order_id in the function product_id_change

By
Selverine
on 1/13/14, 4:56 PM 862 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,

Selverine

1

Grover Menacho

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

Systems Engineer + MBA

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.

0
Selverine
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?

Selverine

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

Selverine
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

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)

Stats

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