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

Add a new tab to the product editor page

By
Robert NNguyen
on 9/4/13, 2:16 PM 1,428 views

Dear experts,

I had a new table that is associated with the product table (many-to-one). I added a new tab to the product editor page to manipulate the rows in this table (add/edit/delete). However, I got an error saying "Invalid XML architecture". I don't know if the framework allows us to do this. My XML looks like below:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
         <record id="product_normal_form_view_conversion" model="ir.ui.view">
            <field name="name">product.normal.form.inherit_conversion</field>
            <field name="model">product.uom.conversion</field>
            <field name="priority">6</field>
            <field name="inherit_id" ref="product.product_normal_form_view"/>
            <field name="arch" type="xml">
                 <page string="Inventory"  position="after">
                    <page string="Conversion">
                       <!--  Field  bindings -->
                    </page>
                </page>
            </field>
        </record>
    </data>
</openerp>

Could you please help me to figure out the issue? Any suggestions are welcome.

Thanks and best regards,

Robert

0

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 9/5/13, 12:40 AM

If you are adding some fields to the product.product model you have to set the model as product.product. Anyways I'm not sure if Inventory tab is on product_normal_form_view, anyways you have to code it like this:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
         <record id="product_normal_form_view_conversion" model="ir.ui.view">
            <field name="name">product.normal.form.inherit_conversion</field>
            <field name="model">product.product</field>
            <field name="inherit_id" ref="product.product_normal_form_view"/>
            <field name="arch" type="xml">
                <xpath expr="//page[@string='Inventory']" position="after">
                    <page string="Conversion">
                       <!--  Field  bindings -->
                    </page>
                </xpath>
            </field>
        </record>
    </data>
</openerp>

Hi Grover Menacho,

Thank you for your answer.

I want to support UOM conversions that don't require a constraint the UOMs belong to the same category (ex. kg <-->m). So I'd like to create a new table (UOM_Conversion) for this purpose.

This table has a "product_id" foreign key, thus I want to make a new tab on the product editor to manage the UOM conversions for a selected product. This is a separate model, not the new properties of the product.product model.

Can I do that? Please advice.

Thanks,

Robert.

Robert NNguyen
on 9/5/13, 2:09 PM

Hmmm, I'm not sure about what you want to do. but if it's related to product you can do it right there. You can have a one2many to another table of conversions, or you can add a many2many to a new model. It depends... I prefer to write and draw before coding a new module or functionality.

GH Mediacloud, Grover Menacho
on 9/9/13, 11:20 PM

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: 9/4/13, 2:16 PM
Seen: 1428 times
Last updated: 3/16/15, 8:10 AM