Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

ParseError: “Invalid view definition”

Subscribe

Get notified when there's activity on this post

This question has been flagged
odooodoo9.0
2 Replies
13841 Views
Avatar
soumaya

I am starting developing openerp modules. What could be wrong with the following code:

  • custmercas.py
    # encoding: utf-8
    from openerp.osv import osv,fields
    class cas_customercas(osv.osv):
        _name = 'cas.customercas'
        _columns = {
            'cas_lastname':fields.char('اللقب', size=50, required=True, readonly=False),
            'cas_firstname':fields.char('الإسم', size=50, required=True, readonly=False),
            #TODO : import time required to get currect date
            'cas_datenaiss': fields.date('تاريخ الولادة'), 
            'cas_lieunaiss':fields.char('مكان الولادة', size=100, required=False, readonly=False),
            'cas_cin': fields.integer('رقم بطاقة التعريف الوطنية'),
            'cas_lieu_cin':fields.char('مكان اصدارها', size=64, required=False, readonly=False),
            'color': fields.integer('Color'),
            #TODO : import time required to get currect date
            'cas_datecin': fields.date('تاريخ اصدارها'),
            'cas_photo':fields.binary('صورة', filters=None),
            'cas_ref':fields.char('المعرف', size=6, required=True, readonly=False), 
            'cas_sexe':fields.char('الجنس', size=10, required=False, readonly=False),
            'cas_pere_id':fields.many2one('cas.customercas', 'الأب',  required=False), 
            'cas_mere_id':fields.many2one('cas.customercas', 'الأم', required=False),
            'cas_telcontacts_ids':fields.one2many('cas.telcontacts', 'cas_customercas_id','قائمة الهواتف', required=False),
            'cas_etatcivil_ids':fields.one2many('cas.customercas.etatcivile', 'cas_customercas_id', 'الحالة المدنية', required=False),
            'cas_adr_ids':fields.one2many('cas.customercas.address', 'cas_adr_customercas_id', 'عناوين الحالات', required=False),
            'cas_boulot_ids':fields.one2many('cas.customercas.boulotsinfo', 'cas_boulot_customercas_id', 'الشغل', required=False),
            'cas_visite_ids':fields.one2many('cas.customercas.visite', 'cas_visite_customercas_id', 'الزيارات', required=False),
            'cas_aide_ids':fields.one2many('cas.customercas.aide', 'cas_aide_customercas_id', 'المساعدات', required=False),
            'cas_logement_ids':fields.one2many('cas.customercas.logement', 'cas_logement_customercas_id', 'المس
    كن', required=False), } customarcas_view.xml <?xml version="1.0" ?> <openerp> <data> <record model="ir.ui.view" id="cas_customercas_view_graph"> <field name="name">cas.customercas</field> <field name="model">cas.customercas</field> <field name="arch" type="xml"> <graph string="Graph View" type="pie"> <field name="cas_cin" /> </graph> </field> </record> <record model="ir.ui.view" id="cas_customercas_kanban_view"> <field name="name">cas.customercas Kanban</field> <field name="model">cas.customercas</field> <field name="arch" type="xml"> <kanban> <field name="cas_photo" /> <field name="cas_lastname" /> <field name="cas_firstname" /> <templates> <t t-name="kanban-box"> <div class="oe_employee_vignette"> <div class="oe_employee_image"> <a data-type="open" href="#" class=" oe_kanban_action oe_kanban_action_a"> <img t-att-src="kanban_image('cas.customercas', 'cas_photo', record.id.value)" class="oe_employee_picture" /> </a> </div> <div class="oe_employee_details"> <h4> <a data-type="open" href="#" class=" oe_kanban_action oe_kanban_action_a"> <b> <field name="cas_ref" /> </b> <t t-if="record.cas_lastname.raw_value"> - <b> <t t-esc="record.cas_firstname.value" /> <field name="cas_lastname" /> </b> </t> </a> </h4> </div> </div> <script> $('.oe_employee_picture').load(function() { if($(this).width() > $(this).height()) { $(this).addClass('oe_employee_picture_wide') } }); </script> </t> </templates> </kanban> </field> </record> <record model="ir.ui.view" id="cas_customercas_tree_view"> <field name="name">cas.customercas.tree</field> <field name="model">cas.customercas</field> <field name="type">tree</field> <field name="arch" type="xml"> <tree string="Liste des cas sociaux"> <field name="cas_lastname" /> <field name="cas_firstname" /> <field name="cas_datenaiss" /> <field name="cas_lieunaiss" /> <field name="cas_ref" /> <field name="cas_photo" widget="image" /> <field name="cas_pere_id" /> <field name="cas_mere_id" /> </tree> </field> </record> <record model="ir.ui.view" id="cas_customercas_form_view"> <field name="name">cas.customercas.form</field> <field name="model">cas.customercas</field> <field name="priority" eval="8" /> <field name="arch" type="xml"> <form string="OpenERP Version 9" version="9.0"> <sheet> <group colspan="4" col="4"> <field name="cas_ref" modifiers="{}" /> <field name="cas_cin" modifiers="{}" /> <field name="cas_datecin" modifiers="{}" /> <field name="cas_lieu_cin" modifiers="{}" /> <field name="cas_lastname" modifiers="{}" /> <field name="cas_firstname" modifiers="{}" /> <field name="cas_datenaiss" modifiers="{}" /> <field name="cas_lieunaiss" modifiers="{}" /> <field name="cas_mere_id" string="الأم" modifiers="{}" /> <field name="cas_pere_id" string="الأب" modifiers="{}" /> <field name="cas_sexe" modifiers="{}" string="الجنس" /> <field name="cas_photo" modifiers="{}" widget="image" /> </group> <notebook> <page string="قائمة الهواتف"> <group colspan="4" col="4"> </group> <field name="cas_telcontacts_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'cas_telcontact_form_view'}"/> </page> <page string="الحالة المدنية"> <group colspan="4" col="4"> </group> <field name="cas_etatcivil_ids" nolabel="1" colspan="3" modifiers="{'readonly': true}" context="{'form_view_ref': 'customercas_etatcivil_tree_view'}"/> </page> <page string="عناوين الحالات"> <group colspan="4" col="4"> </group> <field name="cas_adr_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_adr_form_view'}"/> </page> <page string="الشغل"> <group colspan="4" col="4"> </group> <field name="cas_boulot_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_boulot_form_view'}"/> </page> <page string="الزيارات"> <group colspan="4" col="4"> </group> <field name="cas_visite_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_visite_form_view'}"/> </page> <page string="المساعدات"> <group colspan="4" col="4"> </group> <field name="cas_aide_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_aide_form_view'}"/> </page> <page string="لسكن"> <group colspan="4" col="4"> </group> <field name="cas_logement_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_logement_form_view'}"/> </page> </notebook> </sheet> </form> </field> </record> <record id="cas_customercas_search_view" model="ir.ui.view"> <field name="name">cas.customercas.search</field> <field name="model">cas.customercas</field> <field name="arch" type="xml"> <search string="Search"> <field name="cas_lastname" string="اللقب" filter_domain="[()]" /> <separator /> <filter string="اللقب" name="cas_lastname" domain="[('cas_lastname','!=','g')]" /> <group expand="0" string="Group By..."> <filter string="اللقب" domain="[]" context="{'group_by':'cas_lastname'}" /> </group> </search> </field> </record> </data> </openerp>

    I am getting the error: ValidateError Error occurred while validating the field(s) ParseError: "Invalid view definition!What could be the problem?

    Odoo Server Error
    Traceback (most recent call last):
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 643, in _handle_exception
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 680, in dispatch
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 316, in _call_function
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\service\model.py", line 118, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 309, in checked_call
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 959, in __call__
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 509, in response_wrap
      File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\web\controllers\main.py", line 896, in call_button
      File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\web\controllers\main.py", line 884, in _call_kw
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\base\module\module.py", line 459, in button_immediate_install
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\base\module\module.py", line 533, in _button_immediate_function
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\modules\registry.py", line 386, in new
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\modules\loading.py", line 338, in load_modules
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\modules\loading.py", line 237, in load_marked_modules
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\modules\loading.py", line 156, in load_module_graph
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\modules\loading.py", line 98, in _load_data
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\tools\convert.py", line 851, in convert_file
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\tools\convert.py", line 938, in convert_xml_import
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\tools\convert.py", line 801, in parse
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\tools\convert.py", line 804, in parse
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\tools\convert.py", line 708, in _tag_record
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\base\ir\ir_model.py", line 1142, in _update
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\base\ir\ir_ui_view.py", line 351, in create
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 250, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 354, in old_api
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\models.py", line 4150, in create
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 248, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 490, in new_api
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\models.py", line 4341, in _create
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 248, in wrapper
      File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\models.py", line 1271, in _validate_fields
    ParseError: "Invalid view definition
    
    D\xe9tails de l'erreur :
    Le champ `cas_boulot_ids` n'existe pas
    
    Contexte de l'erreur :
    Vue `cas.customercas.form`
    [view_id: 916, xml_id: n/a, model: cas.customercas, parent_id: n/a]
    None" while parsing file:///C:/Program%20Files/Odoo%209.0-20160413/server/openerp/addons/academy/views/contentview/customercas_view.xml:87, near
    <record model="ir.ui.view" id="cas_customercas_form_view">
                <field name="name">cas.customercas.form</field>
                <field name="model">cas.customercas</field>
                <field name="priority" eval="8"/>
                <field name="arch" type="xml">
                    <form string="OpenERP Version 9" version="9.0">
                        <!-- <header> <button name="action_button" string="gooo" type="object" class="oe_highlight" /> </header> -->
                        <sheet>
                            <group colspan="4" col="4">
                                <field name="cas_ref" modifiers="{}"/>
                                <field name="cas_cin" modifiers="{}"/>
                                <field name="cas_datecin" modifiers="{}"/>
                                <field name="cas_lieu_cin" modifiers="{}"/>
                                <field name="cas_lastname" modifiers="{}"/>
                                <field name="cas_firstname" modifiers="{}"/>
                                <field name="cas_datenaiss" modifiers="{}"/>
                                <field name="cas_lieunaiss" modifiers="{}"/>
                                <field name="cas_mere_id" string="&#1575;&#1604;&#1571;&#1605;" modifiers="{}"/>
                                <field name="cas_pere_id" string="&#1575;&#1604;&#1571;&#1576;" modifiers="{}"/>
                                <field name="cas_sexe" modifiers="{}" string="&#1575;&#1604;&#1580;&#1606;&#1587;"/>
                                <field name="cas_photo" modifiers="{}" widget="image"/>
                            </group>
                            <notebook>
                                <page string="&#1602;&#1575;&#1574;&#1605;&#1577; &#1575;&#1604;&#1607;&#1608;&#1575;&#1578;&#1601;">
                                    <group colspan="4" col="4">
                                    </group>
                                    <field name="cas_telcontacts_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'cas_telcontact_form_view'}"/>
                                </page>
                                <page string="&#1575;&#1604;&#1581;&#1575;&#1604;&#1577; &#1575;&#1604;&#1605;&#1583;&#1606;&#1610;&#1577;">
                                    <group colspan="4" col="4">
                                    </group>
                                    <field name="cas_etatcivil_ids" nolabel="1" colspan="3" modifiers="{'readonly': true}" context="{'form_view_ref': 'customercas_etatcivil_tree_view'}"/>
                                </page>
                                <page string="&#1593;&#1606;&#1575;&#1608;&#1610;&#1606; &#1575;&#1604;&#1581;&#1575;&#1604;&#1575;&#1578;">
                                    <group colspan="4" col="4">
                                    </group>
                                    <field name="cas_adr_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_adr_form_view'}"/>
                                </page>
                                <page string="&#1575;&#1604;&#1588;&#1594;&#1604;">
                                    <group colspan="4" col="4">
                                    </group>
                                    <field name="cas_boulot_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_boulot_form_view'}"/>
                                </page>
                                <page string="&#1575;&#1604;&#1586;&#1610;&#1575;&#1585;&#1575;&#1578;">
                                    <group colspan="4" col="4">
                                    </group>
                                    <field name="cas_visite_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_visite_form_view'}"/>
                                </page>
                                <page string="&#1575;&#1604;&#1605;&#1587;&#1575;&#1593;&#1583;&#1575;&#1578;">
                                    <group colspan="4" col="4">
                                    </group>
                                    <field name="cas_aide_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_aide_form_view'}"/>
                                </page>
                                <page string="&#1604;&#1587;&#1603;&#1606;">
                                    <group colspan="4" col="4">
                                    </group>
                                    <field name="cas_logement_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'customercas_logement_form_view'}"/>
                                </page>
                            </notebook>
                        </sheet>
                    </form>
                </field>
            </record>

0
Avatar
Discard
Avatar
soumaya
Author Best Answer

yes i created this field

'cas_boulot_ids':fields.one2many('cas.customercas.boulotsinfo', 'cas_boulot_customercas_id', 'الشغل', required=False),
0
Avatar
Discard
Zbik

Your custmercas.py module works? Is specified in __init__.py?

soumaya
Author

yes it is specified in __init__.py

Avatar
Ray Carnes
Best Answer

Le champ `cas_boulot_ids` n'existe pas

This means cas_boulot_ids cannot be found.  Did you create this field?

 

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Updating Fields in Existing Modules in Odoo 9 Solved
odoo odoo9.0
Avatar
Avatar
Avatar
4
Jun 16
5748
Odoo Slider
website_builder odoo odoo9.0
Avatar
Avatar
1
Oct 16
10527
Hiding Menus links from Existing Modules of Odoo?
modules odoo odoo9.0
Avatar
Avatar
2
Mar 16
3723
How do I go about this error? I am trying to uninstall a module
odoo
Avatar
0
Nov 25
3359
How to import product variants with my own external id when using dynamic creation mode Solved
odoo
Avatar
Avatar
2
Aug 25
3930
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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