Odoo Help


Field 'name' does not exist - Odoo 9

on 5/12/16, 8:25 AM 1,445 views

Hello :)

I'm trying to add a new module on Odoo 9 following instructions of this (cool ?) tutorial :


but i'm getting "ParseError: "Invalid view definition Error details Field `name` " when installing the module on odoo ? any idea ?


from openerp.osv import osv

from openerp.osv import fields

class Pic_Import(osv.osv):

_name = 'pic.import'

_description = "Module test pour importer une images"

_columns = {

'subject' : fields.char('Subject',size=128,required=True),

'date' : fields.date('Date',required=True),

'note' : fields.text('Notes'),

'amount': fields.float('Amount',required=True),









 # -*- coding: utf-8 -*-


'name': 'Picture Importer',

'summary': "Module de test",

'description': """Chargement d'une image ?""",

'author': "Batman",

'website': "localhost:8069",

# Categories can be used to filter modules in modules listing

# Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml

# for the full list

'category': 'Test',

'version': '0.1',

# any module necessary for this one to work correctly

'depends': ['base'],

# always loaded

'data': [

# 'security/ir.model.access.csv',



# only loaded in demonstration mode

'images': [],


'installable': True,




# -*- coding: utf-8 -*-
import Pic_Import


<?xml version="1.0" encoding ="utf-8"?>



<!-- FORM -->

<record id="view_pic_importer_form" model="ir.ui.view">

<field name="name">pic.import.form.view</field>

<field name="model">pic.import</field>

<field name="arch" type="xml">

<form string="Picture importer" version="1.0">


<field name="name"/>

<field name="date"/>

<field name="type"/>

<field name="note"/>





<!-- View -->

<record id="view_pic_importer_tree" model="ir.ui.view">

<field name="name">pic.import.tree</field>

<field name="model">pic.import</field>

<field name ="arch" type="xml">

<tree string="Import pic">

<field name="name"/>

<field name="date"/>

<field name ="type"/>




<!-- ACTION -->

<record id="action_pic_import" model="ir.actions.act_window">

<field name="name">Import</field>

<field name="res_model">pic.import</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="search_view_id" eval="False"/>

<field name="context">{}</field>

<field name="help">Import new picture</field>



<menuitem name="Picture Importer" id = "base.pic_import_root" sequence="60"/>

<menuitem id="menu_import_pic_root" name="Picture importer" parent="base.pic_import_root" sequence="1"/>

<menuitem action="action_pic_import" id="menu_action_pic_import" parent="menu_import_pic_root" sequence="20"/>





| 7 7 8
Turnhout, Belgium

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

On 5/12/16, 8:33 AM

Hi Azzedine,

When you look at your Python code you have a model named 'pic.import' but on this model you have no field with the name 'name':

class Pic_import(osv.osv):
    _name = 'pic.import'

This created your model name but in the XML code you have this line:

<field name="name"/>

So you're calling the field 'name' on the model 'pic.import' while you don't have this field. Simply add one line to the colums for the field 'name':

_columns = {

'subject' : fields.char('Subject',size=128,required=True), 'name': fields.Char('Name'), }

This will add the field to the model and your view will not crash anymore.


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 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

2 follower(s)


Asked: 5/12/16, 8:25 AM
Seen: 1445 times
Last updated: 5/12/16, 2:14 PM