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

Invalid XML for View Architecture , problem with my new module

By
sanaa tayb
on 5/10/13, 1:37 PM 1,981 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:

patient.py

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

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

    _columns={
                '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),


    }

patient()

xml file:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<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">
                <sheet>

                        <notebook>
                            <page string="Public Information">
                                <group>
                                    <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"/>
                                    </group>
                                </group>
                            </page>
                            <page string=" Information sur le logement">
                                <group>
                                    <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"/>

                                    </group>
                                </group>
                            </page>
                            <page string=" Assurence/prise en charge">
                                <group>
                                    <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"/>

                                    </group>
                                </group>
                            </page>
                        </notebook>
                </sheet>    
            </form>
        </field>
</record>

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



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

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
2050
| 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

server\openerp-server.log

Bista Solutions US, 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
1

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

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. 

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
0
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 :)

0

Borni DHIFI

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

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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