Odoo Help


help with many2one field

sanaa tayb
on 5/13/13, 6:55 PM 1,940 views

hey everybody , can anyone help me with the field many2one ??? in my module i have a field with a drop down list where i want to show all the names of my patients already registered in my database ... Plzzzz help meee

my python file :

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

            #info general
            'name' : fields.many2one('patient.name', 'name'),

} medical()

my xml file :

<field name="name" domain="[('name','=','name')]"/>

Just as specification i want to get the field "name" from the class : patient

_description='dossier administratif du patient'
            'name' : fields.char('numero d`adhesion', size=30,   required=True),

} patient()

On 5/13/13, 7:11 PM

in medical.py

          'patient_id' : fields.many2one('patient', 'Patient'),     

in medical.xml

 <field name="patient_id"/>

so in form medical displays a list of patient by name .

thank you very very much it wored :)

sanaa tayb
on 5/13/13, 7:25 PM

Thank you to mark this question resolved.

on 5/13/13, 7:33 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

0 follower(s)


Asked: 5/13/13, 6:55 PM
Seen: 1940 times
Last updated: 3/16/15, 8:10 AM