Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Field 'name' does not exist - Odoo 9

Subscriure's

Get notified when there's activity on this post

This question has been flagged
errorfieldnameodoo9
1 Respondre
10805 Vistes
Avatar
Azzedine

Hello :)

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

http://fr.slideshare.net/TarunBehal1/odoo-open-erp-creating-a-module-37569034

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

Pic_Import.py

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

'type':fields.selection([

('transport','Transport'),

('household','Household'),

('personal','Personal'),

],

'Type',required=True),

}

__openerp__.py


 # -*- 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',

'views/Pic_Import_view.xml',

],

# only loaded in demonstration mode

'images': [],

'test':[],

'installable': True,

}

  

__init__.py

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

Pic_Import_view.xml

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

<openerp>

<data>

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

<group>

<field name="name"/>

<field name="date"/>

<field name="type"/>

<field name="note"/>

</group>

</form>

</field>

</record>

<!-- 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"/>

</tree>

</field>

</record>

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

</record>

<!--Menu-->

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

</data>

</openerp>

0
Avatar
Descartar
Avatar
Yenthe Van Ginneken (Mainframe Monkey)
Best Answer

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.

Yenthe

1
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
odoo server error
error field
Avatar
Avatar
1
de maig 23
4028
Field not found in 'product.template.product.form' Solved
error field
Avatar
Avatar
2
de març 18
5797
[solved] [odoo-9] : Which lib is missing to resolve this error? Solved
error lessc odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
7
de des. 23
26666
ImportError: No module named openerp
error python2.7 odoo9
Avatar
0
d’abr. 17
6174
Why I get this 'str' object is not callable error with my new function field? Solved
function error field
Avatar
Avatar
2
de febr. 17
8704
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now