Odoo Help

0

Table doesn't get created in the postgres db

By
Amina Khechou
on 5/17/15, 5:44 PM 772 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

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 !!  

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.

Register

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

2 follower(s)

Stats

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