Odoo Help

Welcome!

This community 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.

0

ValidateError while creating new view [Closed]

By
biligsaikhan
on 10/22/14, 11:05 PM 686 views

The Question has been closed for reason: duplicate question

by
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"?>
<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 = {
        '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

biligsaikhan
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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