Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Error in the "Building a Module" tutorial

by
Eska Yazilim, Levent Karakaş
- 06/10/2015 17:30:46
Have you updated your module? I assume it's openacademy...

2015-10-06 17:38 GMT+03:00 Javier Sanchez <jsodoo@spainmail.com>:
Hi
 
I'm trying to understand how to extend Odoo and I am following the tutorials from this page: https://www.odoo.com/documentation/8.0/index.html . 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 https://www.odoo.com/documentation/8.0/howtos/backend.html#inheritance , the first exercise of that section tells you to create a new Model class in a new partner.py file, like this:
 
openacademy/partner.py
# -*- 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?
 
Thanks
 
JS

_______________________________________________
Mailing-List: http://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


Reference