Odoo Help


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.


Adding new fields to existing custom module gives error 'Field *** does not exist'

George Rodopoulos
on 2/5/15, 10:42 PM 4,241 views

I created a custom module for odoo 8.0 following the instructions found here:
and here:

There is no problem adding new fields when I first install it but I have problems adding more fields - by updating the custom module.
I check through
Settings --> Database Structure -->Fields
and I can find the custom fields added when I first installed the custom modules but none of the fields added later.
Of course, after editing my module's .py file  I always restart the odoo server.
When I reference the new fields in my custom view and try to 'upgrade' through the admin interface, I get an error that
Field 'a_new_field_here' does not exist

What can I do to create the new fields (columns) when I restart the odoo server ?

Here is (a simplified version of) the source code of the custom module per file


import custom_tasks


    'name': "custom_tasks",
    'version': "0.0.3",
    'author': "George",
    'category': "Tools",
    'depends': ['project'],
    'data': ['task.xml'],
    'demo': [],
    'installable': True,
    'auto_install': False,
    'application': False,
    'description': "Custom tasks module",


# vim; set filencoding= utf-8

from openerp import api
from openerp.osv import fields, osv
class custom_tasks(osv.osv):
    _name = "project.task"
    _inherit = "project.task"
    _columns = {
        'name': fields.char('Task Summary', track_visibility='onchange', size=128, required=True, select=True),
        'c_task_attachement': fields.binary('Attachemnt (pdf)'),
        'c_task_numbera': fields.integer('Παράμετρος Α'),
        'c_task_numberb': fields.integer('Παράμετρος Β'),
        'c_task_numberc': fields.integer('Παράμετρος Γ'),
        'date_deadline': fields.datetime('Deadline', select=True, copy=False),
    @api.onchange('project_id') # if these fields are changed, call method
    def _check_change(self):
        self.name = self.project_id.name



        <record model="ir.ui.view" id="custom_task">
            <field name="name">project.task.form</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2" />
            <field name="arch" type="xml">
                <xpath expr="/form/sheet/group/group[1]/field[@name='project_id']" position="replace"> </xpath>
                <xpath expr="/form/sheet/h1" position="inside">
                    <field name="project_id" class="oe_inline" required="1" />
                <xpath expr="/form/sheet/h1/field[@name='name']" position="replace">
                    <field name="name" required="1" invisible="1"/>
                <xpath expr="/form/sheet/group/group[2]/field[@name='date_deadline']" position="replace">
                    <field name="date_deadline" required="1"/>
                <xpath expr="/form/sheet/group/group[2]/field[@name='categ_ids']" position="replace">
                    <field name="c_task_attachement" widget="binary"/>
                <xpath expr="/form/sheet/group" position="after">
                        <field name="c_task_numbera" />
                        <field name="c_task_numberb" />
                        <field name="c_task_numberc" />


did you add your py file in the __init__.py of your custom module?

Atchuthan - Technical Consultant, Sodexis Inc
on 2/6/15, 12:09 AM

Can you show your code George Rodopoulos

Umashankar Subramani
on 2/6/15, 12:34 AM

post your code here.

Emipro Technologies Pvt. Ltd.
on 2/6/15, 12:39 AM


| 5 4 7
Lodz, Poland

On 2/9/15, 5:41 AM


  1. Add new field to custom_tasks.py
  2. Restart server
  3. Upgrade your module

In addition, if you use new api in V8, you change custom_tasks.py, and use model.Model, see https://www.odoo.com/documentation/8.0/reference/orm.html#inheritance-and-extension

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

2 follower(s)


Asked: 2/5/15, 10:42 PM
Seen: 4241 times
Last updated: 3/16/15, 8:10 AM