Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Guest House
    • Drankenhandelaar
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Solar Energy Systems
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC Services
    Others
    • Nonprofit Organization
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

I get "Invalid view definition" error but what i'm doing wrong?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
viewsodoo11
3 Antwoorden
20906 Weergaven
Avatar
Daniele Morelli

Hello, I am using odoo 11.

I can't really understand why i keep getting this error. I used 'scaffold' to create a new custom module, and I wrote minimal content in the following files (what I wished to do is to add a column in the treeview for lot/serial number section):

models.py

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

from odoo import models, fields, api


class CustomLot(models.Model):
    _inherit = 'stock.production.lot'
    _name = 'stock.production.lot'
    
views.xml
<odoo>
  <data>
    <record id="custom_lot_view" model="ir.ui.view">
      <field name="name">custom.lot.view</field>
      <field name="model">stock.production.lot</field>
      <field name="inherit_id" ref="stock.view_production_lot_tree"/>
      <field name="arch" type="xml">         
        <xpath expr="//field[@name='product_id']" position="before">
          <p>test</p>
        </xpath>
      </field>
    </record>
  </data>
</odoo> 

For some reason i keep getting the "Invalid view definition" error, and I can't understand what causes it. Maybe it's a dependence problem, so i tried adding dependences in the manifest (to no avail... i tried "stock", "'account_accountant", "sale_stock").

The details of the error:
  File "/opt/odoo/odoo/odoo/addons/base/ir/ir_ui_view.py", line 343, in _check_xml
    raise ValidationError(_('Invalid view definition'))
odoo.tools.convert.ParseError: "Invalid view definition
None" while parsing /opt/odoo/odoo/custom_addons/custom_lot/views/views.xml:3, near
<record id="custom_lot_view" model="ir.ui.view">
      <field name="name">custom.lot.view</field>
      <field name="model">stock.production.lot</field>
      <field name="inherit_id" ref="stock.view_production_lot_tree"/>
      <field name="arch" type="xml">         
        <xpath expr="//field[@name='product_id']" position="before">
          <p>PUPPA</p>
        </xpath>
      </field>
    </record>
I'm really a bit baffled. This is like the sixth custom module i'm defining, and I never had this specific problem. probably i'm doing some very stupid error, but I cannot see where or what.

Thank you very much in advnace for any help.



0
Avatar
Annuleer
Avatar
Jusab Sida (jsi)
Beste antwoord

Remove that P tag and add a real field.

It should be fine.

Regards,

1
Avatar
Annuleer
Daniele Morelli
Auteur

You are right, sir. Thank you very much and please pardon the stupid question... i tried the '<p>' trick in other situations without problems so i didn't think it could be the cause of the error. I'll keep it in mind for the future. Thanks again.

Avatar
Linescripts Softwares
Beste antwoord

Remove the <p> tag.

You can use <p> in QWEB templates but not in generic view.

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Showing data in odoo form or tree view from database table(without any model).
views odoo11
Avatar
Avatar
Avatar
2
sep. 23
9029
fill data to the tree view programmatically Opgelost
views odoo11
Avatar
1
mei 19
7089
many2many_tags widget with hyperlink Opgelost
views many2many_tags odoo11
Avatar
Avatar
Avatar
Avatar
Avatar
4
dec. 23
14266
Which view defines the list of stock movements in stock.move.operations.form? Opgelost
views moves odoo11
Avatar
1
nov. 18
7901
create backorder odoo after validate purchase shipment ? Opgelost
odoo11
Avatar
Avatar
1
okt. 25
11828
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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