Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Odoo8 - Building a module using official documentation - inherit - add instructor boolean field - Field `instructor` does not exist

By
Julian Scherrer
on 8/10/16, 7:36 PM 156 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>

 


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?

Julian Scherrer
on 8/11/16, 8:20 AM
1

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 8/10/16, 7:47 PM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/10/16, 7:36 PM
Seen: 156 times
Last updated: 8/10/16, 7:47 PM