Odoo Help


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.


Created module , new moduel

sanaa tayb
on 6/11/13, 8:25 PM 1,524 views

hello everyone , i created a new module , i can install it , but the problem is that i cant see the entries on my tree .. Plz plz plz help me


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

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

                #info general

                'name' :  fields.char('Numero d`adhesion ', size=30),

                'category_sanguine' : fields.char('Categorie sanguine', size=30, ),

                # maladies
                'maladie_status' : fields.char('Status de la maladie', size=30),
                'date_diagnostique' : fields.date('date de Diagnostique'),
                'age_diagnostique' : fields.char('Age de diagnostique', size=30),
                'severite_maladie' : fields.char('Severite de la maladie', size=30),
                'remarque' : fields.text('Remarque'),
                'retablie' : fields.date('Date de retablissement'),
                'nom_medecin' : fields.char('Nom du medecin', size=30),             
                'alergies' : fields.selection([('Oui','oui'), ('Non','non')],'etes vous allergique?'),
                'allergy_type' : fields.char('Type d`alergie ', size=30),
                'pregnancy_warning' : fields.selection([('Oui','oui'), ('Non','non')],'etes vous enceinte?'),
                'pregnancy_week' : fields.char('Semaine de grossesse ', size=30),
                'on_terapie' : fields.selection([('Oui','oui'), ('Non','non')],'etes vous sous therapie?'),
                'start_terapie' : fields.date('date debut de terapie '),
                'end_terapie' : fields.date('date fin de terapie'),
                'description_terapie' : fields.text('description de la terapie'),
                'extra_info' : fields.text('Extra informations sur le patient'),
                # traitement
                'medicament' : fields.char('medicament', size=30),
                'active' : fields.boolean('active'),
                'debut_traitement' : fields.date('Date de debut de traitement'),
                'fin_traitement' : fields.date('Date de fin de traitement'),
                'medecin' : fields.char('medecin prescrivant le traitement', size=30),
                'indication' : fields.text('Des indications'),
                'tretement_continu' : fields.boolean('traitement continu ?'),
                'tretement_discontinu' : fields.boolean('traitement discontinu ?'),
                'reason_dis' : fields.text('raison de discontinuite ? '),
                'dose' : fields.char('Dosage', size=30),
                'unit_dosage' : fields.char('unite de dosage ', size=30),
                'voie_administration' : fields.char('voie d`administration ', size=30),
                'periode_traitement' : fields.char('periode de traitement ', size=30),
                'frequency' : fields.char('frequence ', size=30),
                'notes' : fields.text('Notes'),




<?xml version="1.0" encoding="utf-8"?>
<menuitem name="Gestion medical" id="menu_patients_parent"/>
<menuitem name="Gestion medical" id="menu_patients_parent1" parent="menu_patients_parent"/>
<menuitem name="Divers" id="menu_patients_parent2" parent="menu_patients_parent"/>  

<record model="ir.ui.view" id="medical_tree_view">
    <field name="name">medical.tree</field>
    <field name="model">medical</field>
    <field name="type">tree</field>
    <field name="arch" type="xml">
        <tree string="medical" version="7.0">

                                         <field name="id"/> 
                                        <field name="name"/>

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


                            <page string=" Maladies">

                                    <group string=" Information generale">
                                        <field name="name"/>
                                        <field name="maladie_status"/>
                                        <field name="date_diagnostique"/>
                                        <field name="age_diagnostique"/>
                                        <field name="severite_maladie"/>
                                        <field name="remarque"/>
                                        <field name="retablie"/>
                                        <field name="nom_medecin"/>

                                    <group string="allergies">

                                        <field name="alergies"/>
                                        <field name="allergy_type"/>


                                    <group string="Grossesses">

                                        <field name="pregnancy_warning"/>
                                        <field name="pregnancy_week"/>


                                    <group string="Terapie">

                                        <field name="on_terapie"/>
                                        <field name="start_terapie"/>
                                        <field name="end_terapie"/>
                                        <field name="description_terapie"/>

                                    <group string="Extra informations">

                                        <field name="extra_info"/>


                            <page string=" Traitements">

                                        <group string=" Medicament et traitement">
                                            <field name="medicament"/>
                                            <field name="active"/>
                                            <field name="debut_traitement"/>
                                            <field name="fin_traitement"/>
                                            <field name="medecin"/>
                                            <field name="indication"/>
                                            <field name="tretement_continu"/>
                                            <field name="tretement_discontinu"/>
                                            <field name="reason_dis"/>
                                        <group string=" Dosage">

                                        <field name="dose"/>
                                            <field name="unit_dosage"/>
                                            <field name="voie_administration"/>
                                            <field name="periode_traitement"/>
                                            <field name="frequency"/>

                                        <group string="Extra informations">

                                            <field name="notes"/>




<record model="ir.actions.act_window" id="tens_form">
    <field name="name">medical</field>
    <field name="res_model">medical</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>

<menuitem name="Dossier Medical" parent="menu_patients_parent1" id="notebook_menu" action="tens_form" sequence="1"/>

plzz help , i can't see the entries on the list view!!!



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

Techno Functional Consultant Odoo(OpenERP) 


Skype : dhifi.borni

On 6/11/13, 8:48 PM


your model name is medicalcase but in xml you use <field name="model">medical</field>

so replace _name='medicalcase' to _name='medical'

   class medicalcase(osv.osv):

the problem is with the field active.

field active is automatically created by openerp if active=true you can see the record else you can not see the record .

so if create a new patient chek the case active. or delete this field from your model.

i actually changed it , but the problem remain the same , whenever i add a new patient ( using the form) i'm not able to see it on the list when i'm supposed to see all my patients , Plz help :s

sanaa tayb
on 6/11/13, 8:52 PM

I changed my answer.

on 6/11/13, 9:16 PM

Thank you Soooo muuch , that was the problem , now it's working fine ;)

sanaa tayb
on 6/11/13, 9:19 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

0 follower(s)


Asked: 6/11/13, 8:25 PM
Seen: 1524 times
Last updated: 3/16/15, 8:10 AM