don't update data table after during/after update module

Bug #983909 reported by 6reduk@gmail.com

This bug report was converted into a question: question #202936: don't update data table after during/after update module.

8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

OpenERP 6.1.

I write and install simple module for test api.
When i add new field in class and viewform system don't update current fields( i change help notation) and don't add new field in data tables, in following gui view can't find new data field and don't work.

Example code.
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('Some name',size=256,required=True,help="Some help"), //field with help and some gui information
        '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>
<...>

New code for update module:

simpleunit.py:
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('NEW name',size=256,required=True,help="NEW help"), //change feild
        '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),
        'new_field':field.char('New field',size=16) //new field
    }
simpleunit()
<....>

when i update this module change not commit and gui not find `field new_field`.

Revision history for this message
6reduk@gmail.com (6reduk) wrote :

if i make new inherit class then i can add new field in subclass and they update through standart update wizzard(web or gtk-client) without error and after that they displayed in view form.

affects: openobject-library → openobject-addons
Amit Parik (amit-parik)
affects: openobject-addons → openobject-server
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Friend,

As you said on comment#1 which is the correct way to do it. Because If we want to add/update the view/table then inheritance is best option. Why we have to write all code again and again..? which doesn't make sense.

So we can not consider this issue as a bug, because for that you have to use inheritance. And after using inheritance it's working fine.

That's why I am converting this to question rather then a bug.

Thanks for understanding!

Changed in openobject-server:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.