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

[Solved] Fields not showing after adding to view - Odoo 8

By
Siobhan
on 5/11/15, 5:54 AM 1,830 views

I am trying to add 2 new fields to module Product with this xml code:


<record id="product_product_template_only_form_view" model="ir.ui.view">

<field name="model">product.product</field>

<field name="inherit_id" ref="product.product_template_only_form_view" />

<field name="arch" type="xml">

<field name="list_price" position="after">

<field name="boatlength" />

<field name="fuelcapacity" />

</field>

</field>

</record>


I have no error message but the fields are not showing where they should be. I checked that the view was correct and it seems to be:


Manage Views (product.template)

Sequence

View Name

View Type

Object

External ID

Inherited View

5 product.template.form.inherit Form product.template account.product_template_form_view product.template.common.form

8 product.template.product.form Form product.template product.product_template_only_form_view product.template.common.form

16 product.form.mrp.inherited Form product.template mrp.view_mrp_product_template_form_inherited


list_price is there :


Product Type

Consumable

Sale Price (name= list_price)

65000.00


What am I doing wrong??

be aware of priorities of views, maybe there were another view with higher priority (or explicitly stated one) loaded into the UI? you can check that using developer mode.

Temur
on 5/11/15, 7:10 AM

Hi,Try to inherit using this id product.product_normal_form_view.

Saravanan Sakthivel
on 5/12/15, 3:24 AM

Saravanan, tried that but got this error: '' cannot be located in parent view.

Siobhan
on 5/13/15, 2:07 AM
2

Jusab Sida (jsi)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
http://www.odoo.com
874
| 2 1 5
Gandhinagar, India
--Jusab Sida (jsi)--


Jusab Sida (jsi)
On 5/28/15, 7:50 AM

Hi Siobhan,

         Can you try this: 

              <field name="model">product.template</field> and take respective View. 



Yes, tried this and this doesn't work either.. maybe I need to see if it is an inherited form like res.partner. Will keep trying but thank you for your help

Siobhan
on 5/29/15, 2:19 AM

Jusab, thank you.. add a class that inherited from product.template and then changed the view form and this works... thank you for your help

Siobhan
on 5/29/15, 2:31 AM

enjoy :)

Jusab Sida (jsi)
on 5/29/15, 3:35 AM
0
Dr Obx
On 5/28/15, 7:20 AM

If you add field in developers mode, appears ?


If yes, then check in what view it shows this field and add correct view name in xml


Hello Rob Yeah did that and it said the view was "product.product_template_only_form_view"... but didn't work.

Siobhan
on 5/29/15, 2:06 AM
0
Siobhan
On 5/12/15, 2:10 AM

Thanks Temur. 

I am new to Odoo and I made the following steps as I have done before to find the view form.

In developer mode, I open a product record, choose "manage views" from the debug dropdown and product.product_template_only_form_view  is the external ID of the one that is selected (I assume that if the radio button is selected then it is the correct view I should be taken). The rest listed seem to be inherited from other modules, tree or kanban views. Not sure what I need to be looking at here to check higher priority.

When I check fields list_price(settings>>data structures) it is under this view: product.product_template_form_view. When I change my xml file to match this, again it is the same. No error, no fields. My two new fields are listed under module product.product. 

The other form I can see is product.product_normal_form_view that has list_price on it. Tried this and got following error:

'<field name="list_price">' cannot be located in parent view

Changed the field to lst_price as this was an alternative name (public price not sale price) and my fields now show up on Product Variant view but not product view. 

Really not sure what I need to here to make this work.

Ok.. this is definitely where I want to put the new fields: This is in form: product.product_template_form_view but when I write the code again with this form it is still not showing

Siobhan
on 5/27/15, 2:02 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: 5/11/15, 5:54 AM
Seen: 1830 times
Last updated: 11/18/15, 8:26 AM