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

can't inherit view correctly

By
kais dkhili
on 5/3/14, 7:37 AM 897 views

Hi, i want to inherit the view partenariat described in the bellow code, and add to it 3 fields

<record model="ir.ui.view" id="partenariat_form"> 
    <field name="name">partenariat.form</field> 
    <field name="model">partenariat</field> 
    <field name="type">form</field> 
    <field name="arch" type="xml">
     <form string="Formulaire partenariat" version="7.0" > 
        <sheet>
           <group col="2" string="Gestion des Partenariats">

            <field name="sujet"/> 
            <field name="organisateur"/>
            <field name="lieu"/> 
            <field name="date_debut"/>
            <field name="date_fin" /> 
          </group>
          </sheet>
        </form>
    </field>
</record>

i wirite the code of the salon view who inherit from patenariat view like bellow:

<record model="ir.ui.view" id="salon_form"> 
    <field name="name">salon.form</field> 
    <field name="model">salon</field> 
    <field name="type">form</field> 
    <field name="inherit_id" ref="partenariat_form"/>  
    <field name="arch" type="xml">
    <xpath expr="/form/sheet/group/field[@name='date_fin']" position="after">
                    <field name="prix_par_metre_salon" widget="integer"/>
                    <field name="espace_reserve_salon" widget="integer"/> 
                    <field name="cout_total_salon" widget="integer"/>
            </xpath>  

    </field> 
</record>

i was succeed to inherit fields, but i dont have a good result because my salon view is not in a sheet and don't have a title, i want that my salon views in a sheet, i try t add sheet balise but also no changes, plz help me

0

Jagdish Panchal

--Jagdish Panchal--
2674
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 5/3/14, 8:27 AM

Hi,

Try this code

<record model="ir.ui.view" id="partenariat_form"> 
    <field name="name">partenariat.form</field> 
    <field name="model">partenariat</field> 
    <field name="type">form</field> 
    <field name="arch" type="xml">
     <form string="Formulaire partenariat" version="7.0" > 
            <sheet>
               <group string="group_test">
                   <group string="Gestion des Partenariats">
                        <field name="sujet"/> 
                        <field name="organisateur"/>
                        <field name="lieu"/> 
                        <field name="date_debut"/>
                        <field name="date_fin" /> 
                    </group>
                </group>
            </sheet>
        </form>
    </field>
</record>

<record model="ir.ui.view" id="salon_form"> 
    <field name="name">salon.form</field> 
    <field name="model">salon</field> 
    <field name="type">form</field> 
    <field name="inherit_id" ref="your_module_name.partenariat_form"/>  
    <field name="arch" type="xml">

            <xpath expr="/form/sheet/group/group[@string='Gestion des Partenariats']" position="after">
                 <group>
                         <field name="prix_par_metre_salon" widget="integer"/>
                        <field name="espace_reserve_salon" widget="integer"/> 
                        <field name="cout_total_salon" widget="integer"/>
                        </group>
            </xpath>  

    </field> 
</record>

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: 5/3/14, 7:37 AM
Seen: 897 times
Last updated: 3/16/15, 8:10 AM