Odoo Help


Invalid XML for View Architecture , problem with my new module

sanaa tayb
on 5/10/13, 1:37 PM 2,479 views

Hello every one , i'm a new in the Openerp Community i have a problem with a module i just created , every time i try to install it the error appears : ValidateError Une erreur est apparue lors de la validation du/des champ(s) arch: Invalid XML for View Architecture! " .... Any ideas plzz ?

here is my code:


from openerp import addons 
from osv import fields, osv
import time

class patient(osv.osv):
    _description='dossier administratif du patient'

                'name' : fields.char('numero d`adhesion', size=30, required=True),
                'cin_patient' : fields.char('CIN', size=30),
                'date_dinscription' : fields.date('Date d`inscription'),
                'num_dossier' : fields.char('numero de dossier', size=30, required=True),
                'nom' : fields.char('Nom', size=30, required=True),
                'prenom' : fields.char('Prenom', size=30, required=True),
                'date_de_naissance' : fields.date('Date de naissance'),
                'sexe' : fields.char('Sexe', size=30),
                'profession' : fields.char('profession', size=30, ),
                'niveau_scolaire' : fields.char('niveau scolaire', size=30),
                'status' : fields.selection([('Celibataire','celibataire'), ('Married','married')]),
                'nb_enfant' : fields.char('Nombre d enfants', size=30),
                'num_fix' : fields.char('Numero de Tel fix', size=30),
                'num_por' : fields.char('Numero de Tel Portable', size=30),
                'adresse' : fields.text('adresse'),
                'cin_assure' : fields.char('CIN de l assure', size=30),
                'non_assure' : fields.char('Nom de l assure', size=30),
                'prenon_assure' : fields.char('prenom de l assure', size=30),
                'type_relation' : fields.char(' ralation avec le patient', size=30),
                'num_assure' : fields.char('Numero d affiliation a une caisse d assurance ', size=30),
                'nom_mutuelle' : fields.char('le nom de la mutuelle', size=30),
                'date_fin' : fields.char('date de fin de la mutuelle ', size=30),
                'proprietaire' : fields.char('etes-vous proprietaire?', size=30),
                'nb_famille' : fields.char('nombre de famille sous le meme toit?', size=30),
                'nombre_chambre' : fields.char('nombre de chambre', size=30),
                'eau' : fields.char(' vous disposez deau?', size=30),
                'electricite' : fields.char('vous disposez delectricite? ', size=30),
                'television' : fields.char('vous disposez de television?', size=30),
                'refrig' : fields.char('vous disposez d un refrigerateur? ', size=30),



xml file:

<?xml version="1.0" encoding="utf-8"?>
<menuitem name="Patient" id="menu_patients_parent"/>
<menuitem name="Patients" id="menu_patients_parent1" parent="menu_patients_parent"/>

<record model="ir.ui.view" id="patient_form_view">
        <field name="name">patient.form</field>
        <field name="model">patient</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Patient" version="7.0">

                            <page string="Public Information">
                                    <group string="Contact Information">
                                        <field name="name"/>
                                        <field name="cin_patient"/>
                                        <field name="date_dinscription"/>
                                        <field name="num_dossier"/>
                                        <field name="nom"/>
                                        <field name="prenom"/>
                                        <field name="date_de_naissance"/>
                                        <field name="sexe"/>
                                        <field name="profession"/>
                                        <field name="niveau_scolaire"/>
                                        <field name="status"/>
                                        <field name="nb_enfant"/>
                                        <field name="num_fix"/>
                                        <field name="num_por"/>
                                        <field name="adresse"/>
                            <page string=" Information sur le logement">
                                    <group string=" Maison et logement">
                                        <field name="proprietaire"/>
                                        <field name="nb_famille"/>
                                        <field name="nombre_chambre"/>
                                        <field name="eau"/>
                                        <field name="electricite"/>
                                        <field name="television"/>
                                        <field name="refrig"/>

                            <page string=" Assurence/prise en charge">
                                    <group string=" Information de l'assure">
                                        <field name="cin_assure"/>
                                        <field name="non_assure"/>
                                        <field name="prenon_assure"/>
                                        <field name="type_relation"/>
                                        <field name="num_assure"/>
                                        <field name="nom_mutuelle"/>
                                        <field name="date_fin"/>


<record model="ir.actions.act_window" id="action_notebook_form">
    <field name="name">patient</field>
    <field name="res_model">patient</field>

<menuitem  parent="menu_patients_parent1" id="notebook_menu_mainform" action="action_notebook_form"/>

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
| 4 5 8
Bronx, United States
--AJ Schrafel Paper Corp--

Exploring OpenERP for business

AJ Schrafel Paper Corp
On 5/10/13, 1:41 PM

look in the log file, it should specifically tell you want the problem is. depending on your installation method it could be /var/log/openerp/ - filename -

Also stop - start your server, then upgrade your module to make sure you are running the latest version you uploaded

i installed the latest version of openerp (openerp 7) on my windows , could you plz tell me where i can find the log file ??

Thanks for your help and answer :)

sanaa tayb
on 5/10/13, 1:55 PM


Ray Carnes
on 5/10/13, 1:57 PM

File "C:\Program Files\OpenERP 7.0-20130422-232436\Server\server.\openerp\osv\orm.py", line 1937, in __view_look_dom_arch except_orm: ('View error', u"Can't find field 'code' in the following view parts composing the view of object model 'patient':\n * patient.tree\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model") 2013-05-10 16:34:24,046 1856 ERROR Avicennefr openerp.tools.convert: Parse error in file:///C:/Program%20Files/OpenERP%207.0-20130422-232436/Server/server/openerp/addons/Nouveau%20dossier%20%20d/patient

sanaa tayb
on 5/10/13, 2:39 PM

this is the error i found in the log file :s

sanaa tayb
on 5/10/13, 2:39 PM

Ray Carnes

--Ray Carnes--
| 9 7 9
Keyport, United States
--Ray Carnes--

Senior ERP Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0 and 11.0.

Completed Odoo Functional and Technical Training.

Functional Areas:

  • CRM/Sales

  • Inventory

  • Manufacturing

  • Accounting

  • Purchasing

Major Skills:

  • Business Process Reengineering

  • Efficiency Consulting

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 5/10/13, 3:16 PM

Can't find field 'code' in the following view parts composing the view of object model 'patient':\n * patient.tree

So the problem is in the treeview definition, which you didn't share with us. Your patient model has no code field, but your treeview is using it.

i agree with ray

AJ Schrafel Paper Corp
on 5/10/13, 6:46 PM

Thanks for your response...

sanaa tayb
on 5/10/13, 7:09 PM
sanaa tayb
On 5/10/13, 1:50 PM

i installed the latest version of openerp (openerp 7) on my windows , could you plz tell me where i can find the log file ??

Thanks for your help and answer :)



--Borni DHIFI--
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 


Skype : dhifi.borni

On 5/10/13, 1:58 PM

I have tested your module it works without problem. restart your server and go Setting>>Modules>>Update Module List.

i did all those steps and it didn't work :s

sanaa tayb
on 5/10/13, 2:39 PM

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

1 follower(s)


Asked: 5/10/13, 1:37 PM
Seen: 2479 times
Last updated: 3/16/15, 8:10 AM