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

Asked by 6reduk@gmail.com

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`.

Question information

Language:
English Edit question
Status:
Expired
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Amit Parik (amit-parik) said :
#1

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!

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.