Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Artificial Intelligence
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

ValidateError while creating new view

Odebírat

Get notified when there's activity on this post

This question has been flagged
2 Odpovědi
4857 Zobrazení
Avatar
biligsaikhan

I keep getting this error while trying to parse xml with new views. 

ParseError: "ValidateError Field(s) `arch` failed against a constraint: Invalid view definition

my code for xml

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


<!--Daily Transaction List View  -->
    <record id="daily_transaction_tree_view" model="ir.ui.view">
     <field name="name">daily.transaction.tree</field>
     <field name="model">daily.transaction</field>
    <field name="arch" type="xml">            
 <!-- this will be our title of list/tree view   -->            
    <tree string="Daily Transaction">                
 <!-- these will automatically map table headers for our list view, so we’ll select out column names of our model here  -->          
    <field name="name"/>               
    <field name="date"/>               
    <field name="type"/>                 
    <field name="amount"/>                   
    </tree>             
    </field>
    </record>     

<!--Daily Transaction Form View-->    
    <record id="daily_transaction_form_view" model="ir.ui.view">
     <field name="name">daily.transaction.form</field>
     <field name="model">daily.transaction</field>     
    <field name="arch" type="xml">            
<!-- this will be our title of list/tree view -->            
    <form string="Daily Transaction" version="8.0">                
    <group>                    
    <field name="name"/>                    
    <field name="date"/>                    
    <field name="type"/>
    <field name="amount"/>                     
    <field name="note"/>                                   
    </group>             
    </form>        
    </field>    
    </record>

    <record id="action_daily_transaction" model="ir.actions.act_window">        
    <field name="name">Daily Transaction</field>        <!-- name of action -->
    <field name="res_model">daily.transaction</field>        <!-- this action will be mapped to model specified -->
    <field name="view_type">form</field>        
    <field name="view_mode">tree, form</field>        <!-- these are type of view our module will show for our daily transaction mode  -->
    <field name="search_view_id"  eval="False"/>        <!-- here we specify id of our search view -->
    <field name="context">{}</field>        
    <field name="help">Create new daily transaction.</field>    <!-- help text for our model -->
    </record> 
    
    <!-- Main Menu Related Info -->
    <menuitem name="Daily Transaction" id="base.daily_transaction_root" sequence="60"/>

    <!-- Sub Menu Related Info -->
    <menuitem id="menu_daily_transaction_root" name="Daily Transaction"
    parent="base.daily_transaction_root" sequence="1"/>
    
    <!-- Action Menu Related Info -->
    <menuitem action="action_daily_transaction" id="menu_action_daily_transaction"
    parent="menu_daily_transaction_root" sequence="20"/>
    
    </data>
    </openerp>

my code for py

from openerp.osv import fields, osv

class daily_transaction(osv.osv):
    _name = 'daily.transaction'
    _description = 'Daily Transaction'
    
    
    _columns = {

        'name':  fields.char('Name', size=128, required=True),
        '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'),
            ], required=True),
            
    }

0
Avatar
Zrušit
Avatar
Ben Bernard
Nejlepší odpověď

I think you should explicitly define "name" field in daily_transaction model.

And, the "subject" field should be defined in the view because it's required.

0
Avatar
Zrušit
Avatar
Med Said BARA
Nejlepší odpověď

Try to post the error message from your .log file

Between time try to Copy/Paste the following parsed code:

 

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <!--Daily Transaction List View  -->
        <record id="daily_transaction_tree_view" model="ir.ui.view">
            <field name="name">daily.transaction.tree</field>
            <field name="model">daily.transaction</field>
            <field name="arch" type="xml">
                <!-- this will be our title of list/tree view   -->
                <tree string="Daily Transaction">
                    <!-- these will automatically map table headers for our list view, so we’ll select out column names of our model here  -->
                    <field name="name"/>
                    <field name="date"/>
                    <field name="type"/>
                    <field name="amount"/>
                </tree>
            </field>
        </record>
        <!--Daily Transaction Form View-->
        <record id="daily_transaction_form_view" model="ir.ui.view">
            <field name="name">daily.transaction.form</field>
            <field name="model">daily.transaction</field>
            <field name="arch" type="xml">
                <!-- this will be our title of list/tree view -->
                <form string="Daily Transaction" version="8.0">
                    <group>
                        <field name="name"/>
                        <field name="date"/>
                        <field name="type"/>
                        <field name="amount"/>
                        <field name="note"/>
                    </group>
                </form>
            </field>
        </record>
        <record id="action_daily_transaction" model="ir.actions.act_window">
            <field name="name">Daily Transaction</field>
            <!-- name of action -->
            <field name="res_model">daily.transaction</field>
            <!-- this action will be mapped to model specified -->
            <field name="view_type">form</field>
            <field name="view_mode">tree, form</field>
            <!-- these are type of view our module will show for our daily transaction mode  -->
            <field name="search_view_id"  eval="False"/>
            <!-- here we specify id of our search view -->
            <field name="context">{}</field>
            <field name="help">Create new daily transaction.</field>
            <!-- help text for our model -->
        </record>
        <!-- Main Menu Related Info -->
        <menuitem name="Daily Transaction" id="base.daily_transaction_root" sequence="60"/>
        <!-- Sub Menu Related Info -->
        <menuitem id="menu_daily_transaction_root" name="Daily Transaction"
        parent="base.daily_transaction_root" sequence="1"/>
        <!-- Action Menu Related Info -->
        <menuitem action="action_daily_transaction" id="menu_action_daily_transaction"
        parent="menu_daily_transaction_root" sequence="20"/>
    </data>
</openerp>

 

0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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