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

Table doesn't get created in the postgres db

By
Amina Khechou
on 5/17/15, 5:44 PM 535 views

Hey,

I really need your help, i just started working on Odoo , well I have create a module of course's management, i can load my module but the database the table isn't created :s and i don't know why ???

ps: the file __init__.py --> import test.py

the code is : test.py 


from osv import osv,fields

#*****************

#Classe 1 : filiere

#*****************

class filiere(osv.osv):

#Le nom de la table dans ODOO

_name ='filiere'

_description ="pour la filiere "

#_columns : ce sont les champs que l'on va créer dans la table filiere

_columns = {

#C'est dans ce champ qu'on enregistrera le code du filiere.

'code' :fields.char('code', size=30, required=True),

'theme' :fields.char('theme', size=30, required=True),

'description' :fields.text('Les informations sur la filiere'),

#On enregistrera ici le nom du module. Ce champ fait la relation avec la table modules qui contient les informations de chaque module.

'module' : fields.many2one('module', 'module', required=True),

}

filiere()

#*****************

#Classe 2: etudiant

#*****************

class etudiant(osv.osv):

_name ='etudiant'

_description ="pour l'etudiant "

_columns = {

'codeApoge' :fields.char('codeApoge', size=30, required=True),

'nom' :fields.char('nom', size=30, required=True),

'prenom' :fields.char('prenom', size=30, required=True),

'tel' :fields.char('tel', size=30, required=True),

'adresse' :fields.char('adresse', size=30, required=True),

'description' :fields.text('Les informations sur la filiere')

}

etudiant()

#*****************

#Classe 3: modules

#*****************

class module(osv.osv):

_name ='module'

_description ="pour un module "

_columns = {

'nommodule' :fields.char('nommodule', size=30, required=True)

}

module()

Did the module itself install and without errors? I wouldn't honestly ever name a file 'test.py', since test might be reserved or used for other things. So first try another filename and update your module.

Yenthe
on 5/18/15, 1:57 AM
1

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3918
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 5/18/15, 2:19 AM

In __init__.py,

You need to add only the filename

i.e. import test

0
Amina Khechou
On 5/18/15, 10:13 AM

Atchuthan, I know that's what i did i've just made a mistake copying the module name, but in my file it's written import test thanks

Yenthe, i'll try this right now thanks !!  

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

2 follower(s)

Stats

Asked: 5/17/15, 5:44 PM
Seen: 535 times
Last updated: 5/18/15, 10:13 AM