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

populate value for parent object from child object

By
Maniganda
on 2/28/14, 3:03 AM 1,295 views

Is it posible to populate the value from onchange_event in child object to parent_object.

Let us assume, we have sale_order - parent object sale_order_line - child object

by using the onchange product_id in sale_order_line is ir possible to populate the value for the parent object sale_order fields

0

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 4/2/14, 11:29 AM

You could always use

self.pool.get('sale.order').write(.....)

But I've been told that this is neither well apllicable nor good style.

For better help please give more details on what you are trying to do.

Have you thought about using an onchange function in sale_order on sale_order_lines?
If product_id changes the sale_order_line might change which triggers the onchange that has direct acces to the sale_order fields.

how can you use self.pool.get('sale.order').write(.....) when you are creating a new object

Maniganda
on 4/3/14, 2:34 AM

Maybe I've mistaken your question.

You can use self.pool.get('sale.order').create(....) when you want to create a new record.

But again: Don't do this in practice, if avoidable.

René Schuster
on 4/3/14, 6:29 AM
0
Hussein Kamel
On 4/2/14, 10:58 AM

I have the same issue, until now I have not solved it yet. Any help please

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: 2/28/14, 3:03 AM
Seen: 1295 times
Last updated: 3/16/15, 8:10 AM