Skip to Content
Menu
This question has been flagged
1 Reply
2757 Views

Hello dear community,

i am trying to build a module in Odoo 8 following the offifial documentation of odoo.com.

https://www.odoo.com/documentation/8.0/howtos/backend.html#build-an-odoo-module

 Now I came to my recent error [1] (Field `instructor` does not exist). This error occured after the implementation of the exercise of chapter "View Inheritance". My __init__.py , __openerp__.py and the relevant partner.py and partner.xml are copy and pasted from the doc. Nevertheless I post them into this topic as [2], [3], [4] and [5]. The error dissapears if "instructor" is replaced by "name" in partner.xml or if the code is deleted . It semms for me that 'inherit' dosen't work properly because the field 'name' is  propably in the form that should be extended and using it doesn't produce the error.


Things I've tried:

- building the module from scratch by using the given code, no effect


thank you very much in advance


[2...5]:  https://codedump.io/share/MIwoMPIShmxa/1/odoo8---building-a-module---inherit---add-instructor-boolean-field---field-instructor-does-not-exist

[1] -error:


ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition

Error details:
Field `instructor` does not exist

Error context:
View `partner.instructor`
[view_id: 413, xml_id: openacademy.partner_instructor_form_view, model: res.partner, parent_id: 126]" while parsing file:///C:/myaddons/openacademy/views/partner.xml:4, near
<record model="ir.ui.view" id="partner_instructor_form_view">
            <field name="name">partner.instructor</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="arch" type="xml">
                <notebook position="inside">
                    <page string="Sessions">
                        <group>
                            <field name="instructor"/>
                        </group>
                    </page>
                </notebook>
            </field>
        </record>

 


Avatar
Discard
Author

I.'ll comment here as an answer to you Ray Carnes from 11.08.16 01:47 am. I lack one karma point to beeing able to comment your answer.

Thank you very much for your answer, Ray.

Yes, I restarted the Odoo server as well as the PostgreSQL server. And I also updated every time before looking for any changes. In fact, the error shows up when upgrading. I forgot to write that earlier, my bad.

Am I the only one that experiences this error following the mentioned Howto?

Best Answer

Odoo, like any Python based program, reads the source code and compiles it at runtime.

Did you restart the server before updating your module as you built it?  Odoo won't see any changes to Python files between reboots.  And, you must UPDATE the module each time your Python code affects field definitions, and every time you make XML changes.  It is safest to ALWAYS update your module each time you make ANY changes to it.

Avatar
Discard