Contributors mailing list archives


Error in the "Building a Module" tutorial

by "Javier Sanchez" <> - 06/10/2015 14:28:19
I'm trying to understand how to extend Odoo and I am following the tutorials from this page: . I believe they were created by the community so I am writting her. If I am writing to the wrong mailing list, please feel free to correct and direct me to the appropiate one. Should I open a bug report about the tutorial?
In the "Inheritance" part of the "Building a Module" tutorial , the first exercise of that section tells you to create a new Model class in a new file, like this:
# -*- coding: utf-8 -*-
from openerp import fields, models

class Partner(models.Model):
    _inherit = 'res.partner'

    # Add a new column to the res.partner model, by default partners are not
    # instructors
    instructor = fields.Boolean("Instructor", default=False)

    session_ids = fields.Many2many('openacademy.session',
        string="Attended Sessions", readonly=True)
I have made the previous tutorials exercises without real problems, but when I run the server after adding this model and try to log in I get this mistake while the browser displays a error message:
2015-10-06 12:27:12,618 2019 INFO odoo openerp.sql_db: Programming error: column res_partner.instructor does not exist
then with the SQL order which is trying to execute which includes a reference to res_partner.instructor column: as "name","res_partner"."instructor" as "instructor","res_partner"."street2" as . Obviously the table res_partner does not have a instructor column and if I remove the instructor field from the Model Odoo loads fine again. session_ids does not gives any error.
I have downloaded the last version from github as recommended in the installing section, which right now is Odoo v9, but the tutorial is for the v8 version. Has the inheritance model changed so much? Can someone point out why is the example failing?