Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Field 'name' does not exist - Odoo 9

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
errorfieldnameodoo9
1 Répondre
10690 Vues
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
Ignorer
Avatar
Yenthe Van Ginneken (Mainframe Monkey)
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
odoo server error
error field
Avatar
Avatar
1
mai 23
3862
Field not found in 'product.template.product.form' Résolu
error field
Avatar
Avatar
2
mars 18
5610
[solved] [odoo-9] : Which lib is missing to resolve this error? Résolu
error lessc odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
7
déc. 23
26442
ImportError: No module named openerp
error python2.7 odoo9
Avatar
0
avr. 17
6048
Why I get this 'str' object is not callable error with my new function field? Résolu
function error field
Avatar
Avatar
2
févr. 17
8521
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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