This question has been flagged

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

Avatar
Discard

I look forward to reading it.  Thanks.

Author

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!

Author Best Answer

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

Avatar
Discard

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.

Author

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.