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.

2

How to add new tab to module in Odoo 8?

By
Yenthe
on 9/5/14, 9:28 AM 2,247 views

Hey guys

I've been trying to add a new tab to the "Products" view under sales but I can't get any new tabs made.
Could anybody tell me how/where to do this please? I know there is an answer for V7 (https://www.odoo.com/forum/help-1/question/how-to-add-new-tab-to-module-19050) but there is no information about how to do it in V8.
You can see what I want here: http://imgur.com/M5khmn8


With kind regards
Yenthe

I look forward to reading it.  Thanks.

Stephen Mack
on 9/5/14, 11:54 AM

Stephen, I've written out the guide for V8 in the comment down here. This is currently for V8 but I will probably add one for V7 too. Hope this explains everything you need!

Yenthe
on 9/8/14, 2:31 AM
0

Yenthe

--Yenthe--
6706
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 9/5/14, 11:20 AM

Found the solution myself.

Odoo V8:

1. Go to 'about Odoo'
2. Activate the developer mode.
3. Go to your view you want to edit, for example to sales > products and open up a product.
4. Open the debug view (top left) and click on edit FormView
5. Find the field 'inherited view' and open it.
6. Edit the code under the architecture tab in the new window.
6A. You should first add the fields you want to add to your view in your database. The model where you should insert this is in the 'Object' field, for example product.template. You can add fields to a model by going to settings > Database structure > models. Find the correct model there, make your new fields, give them the correct type and save them.
6B. Edit the code under the architecture tab and add the fields with the same name as you've named them in the database.
7. Save and refresh your page, you will now see your now tab with fields.

I've also made a guide about this in image form with even more information which can be found here: http://imgur.com/a/1C1gK
 

Odoo V7:
1. Go to 'about Odoo'
2. Activate the developer mode.
3. Go to your view you want to edit, for example to sales > products and open up a product.
4. Open the debug view (top left) and click on edit FormView
5. Edit the code under the architecture tab.
5A. You should first add the fields you want to add to your view in your database. The model where you should insert this is in the 'Object' field, for example product.product. You can add fields to a model by going to settings > Database structure > models. Find the correct model there, make your new fields, give them the correct type and save them.
5B. Edit the code under the architecture tab and add the fields with the same name as you've named them in the database.
6. Save and refresh your page, you will now see your now tab with fields.

I've also made a guide about this in image form with even more information which can be found here: http://imgur.com/a/UphvK

Hi Yenthe, What's happen in code when we do like this. I did this one but i unable to traced out one thing, odes It adds the code in actual module or does it will create separate files for this extra fields.

samba
on 9/6/14, 12:47 AM

samba, what exactly would you like to know? I think you'd like to know the flow of your data? In essence all the data in your new fields will be handled by Odoo and saved into the correct fields of the model. You only need to add the fieldnames to the model and edit the code and your set to go. Odoo will track where your data should be stored thanks to the model path and the fieldnames! I hope this answers your question.

Yenthe
on 9/8/14, 2:47 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

2 follower(s)

Stats

Asked: 9/5/14, 9:28 AM
Seen: 2247 times
Last updated: 3/16/15, 8:10 AM