This question has been flagged
1 Reply
4406 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

Avatar
Discard
Best Answer

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>
Avatar
Discard
Author

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.

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.