← Back to team overview

openerp-india team mailing list archive

[Bug 984066] [NEW] problem update fields in inherited view form.

 

You have been subscribed to a public bug:

i make simple class for test API:

simpleunit.py:
<....>
class simpleunit(osv.osv):
    _name="simple.unit"
    _description="For keeping some test personal data"
    _columns={
        'unit_id':fields.char('Registration ID Number',size=256,required=True),
        'unit_name':fields.char('Unit Name',size=256,required=True),
        'father_name':fields.char('Father Name',size=256,required=True),
        'gender':fields.selection([('male','Male'),('female','Female')],'Gender'),
        'contact_number':fields.char('Contuct number',size=256,required=False)
    }
simpleunit()
<....>


simpleunit_view.xml:

<....>
       <record model="ir.ui.view" id="simple_unit_form">
            <field name="name">simple.unit.form</field>
            <field name="model">simple.unit</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Simple Unit Form">
                    <group colspan="4" string="My_group">
                    <field name="unit_id"/>
                    <field name="unit_name"/>
                    <field name="father_name"/>
                    <field name="gender"/>
                    <field name="contact_number"/>
                    </group>
                </form>
            </field>
       </record>
<....>

this code work fine in web and gtk-client.

After it i make subclass.
extended_simpleunit.py:
<....>
class extend_simple_unit(osv.osv):
    _name='simple.unit'
    _inherit='simple.unit'
    _columns={
        'parkur_lvl':fields.selection([('beginner','Beginner'),('middle','Middle'),('pro','Pro')],'Parkur lvl'),
        'parkur_stage':fields.integer('Parkur Stage(years)'),
        'parkur_style':fields.char('Parkur Style',size=40,readonly=False),     
        'parkur_jumps':fields.char('Count jumps',size=40,readonly=False),     
    }    
extend_simple_unit()
<....>

and extended_simpleunit_view.xml:
<....>
        <record model="ir.ui.view" id="extend_simple_unit_form_inherit">
            <field name="name">extend.simple.unit.form.inherit</field>
            <field name="model">simple.unit</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="simpleunit.simple_unit_form"/>
            <field name="arch" type="xml">
                <xpath expr="/form/group[@name='My_group']" position="after">
                    <group colspan="4" string="Parkur">
                        <field name="parkur_lvl"/>
                        <filed name="parkur_jumps"/>
                        <group colspan="2" string="internal_group">
                                <filed name="parkur_jumps"/>
                        </group>
                    </group>
                </xpath>
            </field>
        </record>
<....>


This code work, but if i move some field to another place in view form(move to new group/pages etc), then this field is disappear -it's wonderfull but useless.  And more if i add new field in subclass and inherit view form they disappear too.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
problem update fields in inherited view form.
https://bugs.launchpad.net/bugs/984066
You received this bug notification because you are a member of OpenERP Indian Team, which is subscribed to OpenERP Addons.