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

I defined a form view as primary inheriting of the regular one, but it's not showing up. Why?

By
Kit Sunde
on 12/10/14, 3:40 PM 927 views

I'm trying to create a special form view for an `act_window` but instead it's showing the regular one. This is what I've done:

    <record id="mrp_bom_form_view_master" model="ir.ui.view">
      <field name="name">mrp.bom.master</field>
      <field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
      <field name="model">mrp.bom</field>
      <field name="mode">primary</field>
      <field name="arch" type="xml">
        <field name="name" position="after">
          <h1>Show me.</h1>
        </field>
      </field>
    </record>

    <record model="ir.actions.act_window" id="mrp_bom_form_action_base">
      <field name="name">Master Bill of Materials</field>
      <field name="res_model">mrp.bom</field>
      <field name="view_type">form</field>
      <field name="view_mode">form,tree</field>
      <field name="view_id" ref="mrp_bom_form_view_master"/>
      <field name="search_view_id" ref="mrp.view_mrp_bom_filter"/>
    </record>

    <record model="ir.actions.act_window" id="mrp_bom_form_action_master_product">
      <field name="name">Master Products</field>
      <field name="domain">[('is_master', '=', True), ('category', '=', 'product')]</field>
      <field name="res_model">mrp.bom</field>
      <field name="inherit_id" ref="mrp_bom_form_action_base"/>
    </record>

    <menuitem
            action="mrp_bom_form_action_master_product"
            id="menu_manufacturing_master_product"
            parent="menu_manufacturing_sana_master"
            name="Products"
            sequence="1"/>


Why doesn't it work?

0
Mohamed Essakali
On 12/10/14, 3:57 PM

use priority field, the view with the high priority will be displayed

<record id="mrp_bom_form_view_master" model="ir.ui.view">
      <field name="name">mrp.bom.master</field>
      <field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
      <field name="model">mrp.bom</field>
      <field name="priority">20</field>
      <field name="arch" type="xml">
        <field name="name" position="after">
          <h1>Show me.</h1>
        </field>
      </field>
    </record>

Your version is missing mode **primary**, I need it to not extend the default mrp_bom_form_view. Putting priority doesn't affect anything.

Kit Sunde
on 12/10/14, 4:06 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

1 follower(s)

Stats

Asked: 12/10/14, 3:40 PM
Seen: 927 times
Last updated: 3/16/15, 8:10 AM