Odoo Help


ValidateError while creating new view [Closed]

on 10/22/14, 11:05 PM 1,181 views

The Question has been closed for reason: duplicate question

Ludo - Neobis
on 10/24/2014 04:48:48

i keep getting this error while parsing 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"?>

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

<!--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">                
    <field name="name"/>                    
    <field name="date"/>                    
    <field name="type"/>
    <field name="amount"/>                     
    <field name="note"/>                                   

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

my code for py

from openerp.osv import fields, osv

class daily_transaction(osv.osv):
    _name = 'daily_transaction'
    _description = 'Daily Transaction'
    _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'),
            ], required=True),

i know this is duplicated. but this was posted by a bug on tags. i have already reported the bug and cannot delete this since don't have enough karma

on 10/23/14, 12:21 AM

I will close this issue for you.

Ludo - Neobis
on 10/24/14, 4:48 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 10/22/14, 11:05 PM
Seen: 1181 times
Last updated: 3/16/15, 8:10 AM