This question has been flagged
1 Reply
2501 Views

Hello, I'm puzzling over what seems to be valid xml and a valid model. If I remove the '<field name="health_card_id"/> it works and it shows an empty notebook page, the code is as follows:

Model:

class hr_employee_uy(osv.osv):

    _name = 'hr.employee'
    _inherit = 'hr.employee'
    _columns = {
        'country_of_birth':fields.many2one('res.country','Pais de nacimiento'),
        'health_card_id':fields.char('Numero de carne de salud',size=15),
    }
hr_employee_uy()

view:

<?xml version="1.0"?>
<openerp>
<data>
<record id="hr_employee_view" model="ir.ui.view" >
    <field name="name">hr.employee.form.inherit</field>
    <field name="model">hr.employee</field>
    <field name="inherit_id" ref="hr.view_employee_form"/>
    <field name="arch" type="xml">
    <data>
        <group string="Citizenship & Other Info"> 
            <field name='country_of_birth'/>
        </group>
        <notebook>
            <page string='Datos de salud'>
                <field name='health_card_id' />
            </page>
        </notebook>
    </data>
    </field>
</record>
</data>
</openerp>

what problem am I having? the model itself doesn't seem to have a problem and as far as I understand this is valid and correct view syntax.

Thanks in advance.

Best regards, Bruno Figares.

Avatar
Discard
Best Answer

Here If you inherit model than no requirement of _name. So remove _name and update your module. It will work.

Avatar
Discard
Author

Hey, thanks for the quick answer. At first I tried your solution by updating the module and the problem persisted, afterwards I tried nuking the db and it worked just fine once I reinstalled the module. Thanks for the help!

You are Welcome Mr Bruno. In future if you need any help contact us on openies.com@gmail.com.