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.

3

Is it possible to create a view which inserts in 2 different tables?

By
Yakito
on 2/19/13, 1:49 PM 1,172 views

Hello,

I am learning how to develop my own modules, and for it I need to create a new view with different pages inside.

I wish to be able to insert some of the fields in the main table created by the class, and the fields which are inside the page of the view into another table.

Is this possible? If someone can point me in the right direction I will appreciate it!

Thanks!

2

Andreas Brueckl

--Andreas Brueckl--
5056
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 3/10/13, 7:54 AM

You can use fields of type related to update fields which are not part of the actual model.

Here is an example from model stock.move:

'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Source", store=True),

This code maps the origin of the stock.picking to the origin of the stock.move. So you can change the origin field of stock.picking from within the stock.move model.

Update:

You can also use a function field and define a method for argument fnct_inv. (See the Developer documentation)

Perfect I think this will work. I will test and then come back to mark the answer right. Thanks a lot!

Yakito
on 3/10/13, 10:23 AM

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

1 follower(s)

Stats

Asked: 2/19/13, 1:49 PM
Seen: 1172 times
Last updated: 3/16/15, 8:10 AM