0
votes

I made a module adding some models among others "Showroom". I added a page to a view that inherits from product.product_normal_form_view. This seems to work, but; The extra page only shows up on the variant form, not the "regular" product form.

Does anyone know what couses this behavour, and how to solve it?

Thanks,

Bert

<?xml version="1.0" encoding="UTF-8"?>
  <openerp>
        <data>
            <record model="ir.ui.view" id="product_showroom_form_view">
                <field name="name">product.showroom</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='Information']" position='after'>
                        <page string="Showroom">
                            <group>
                                <field name="panel_id"/>
                            </group>
                        </page>
                    </xpath>
                </field>
            </record>
        </data>
</openerp>
1

1 Answers

1
votes

Here you use product.product_normal_form_view as your inherit_id. But this view is only specific to Product Variants.

For detailed understanding you can open that file that contains this form view (product.product_normal_form_view). Means your parent view.

Now, as you see in that form-view there are some fields defined.

But those fields are visible in product form view(in web-browser) if that product has no variant. (See the products that don't have any variants)

If product has variant then those fields are not visible in main product from view. Those are visible in its variant's from view. Not in the Main View. (See the products that have variants)

So, here the problem is that... you inherit that variants form view. So, If your product contains variants then, your changes is visible in its variants form view. Not in the main view.

So, change your inherit_id to Main Product Form-View..... And It's working properly.. :)