Skip to Content
Menu
This question has been flagged
2 Replies
4396 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

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author Best Answer

Hi Grover,

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

Selverine

Avatar
Discard

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

Author

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

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