Skip to Content
Menu
This question has been flagged
3 Replies
4135 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()

Avatar
Discard

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.

Best Answer

In __init__.py,

You need to add only the filename

i.e. import test

Avatar
Discard
Author Best Answer

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

Avatar
Discard