Odoo Help


geetting an assertionerror?

eoin ahern
on 3/2/14, 1:53 PM 1,958 views

just getting used to openerp. building a simple entity class and view for a contact list. which looks like this

from openerp.osv import osv,fields

class contact(osv.Model):
    _name = "contact.contact"
    _columns = {
        'name': fields.text('Contacts Name', size=80, required=True),
        'gender': fields.selection('Sex', [('Male', 'Male'), ('Female', 'female')], required=True),
        'email': fields.text('Email address', size=60),
        'number': fields.text('Phone Number', size=20),
    _defaults = {
         'name': 'eoin',
         'active': True,

when i try to install the module i get the following error.

AssertionError: Default function defined in contact.contact but field active does not exist !

can anyone help me with this?


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 3/2/14, 4:02 PM

The problem is _defaults. Look on it again you have given active field in _defaults but you didn't defined it in _columns.

So either remove it from _defaults or define the field.

deleted that but still get the same error?

eoin ahern
on 3/2/14, 4:55 PM

After make changes in py file, you have to restart OpenERP server.

Sudhir Arya (ERP Harbor Consulting Services)
on 3/3/14, 4:15 AM

thanks you. realise this now. but iam still getting errors likre the following

eoin ahern
on 3/3/14, 4:12 PM

ProgrammingError: syntax error at or near "ARRAY" LINE 1: COMMENT ON COLUMN contact_contact."gender" IS ARRAY[('Male',...

eoin ahern
on 3/3/14, 4:13 PM
eoin ahern
On 3/2/14, 4:07 PM

thanks, yeah i just copied some of this from another example so didnt really know what i was at.

yeah deleted that line and it still get the same error

eoin ahern
on 3/2/14, 4:44 PM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/2/14, 1:53 PM
Seen: 1958 times
Last updated: 3/16/15, 8:10 AM