Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Field 'name' does not exist - Odoo 9

Odoberať

Get notified when there's activity on this post

This question has been flagged
errorfieldnameodoo9
1 Odpoveď
10839 Zobrazenia
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
Zrušiť
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
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
odoo server error
error field
Avatar
Avatar
1
máj 23
4051
Field not found in 'product.template.product.form' Solved
error field
Avatar
Avatar
2
mar 18
5820
[solved] [odoo-9] : Which lib is missing to resolve this error? Solved
error lessc odoo9
Avatar
Avatar
Avatar
Avatar
Avatar
7
dec 23
26696
ImportError: No module named openerp
error python2.7 odoo9
Avatar
0
apr 17
6196
Why I get this 'str' object is not callable error with my new function field? Solved
function error field
Avatar
Avatar
2
feb 17
8724
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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