Hello
I'm debutant in odoo development , and wrote this test module:
***********************************************
class documents(osv.Model):
_name = 'documents'
_description = u'Association class'
_columns = {
'nom': fields.char(_(u'nom et prenom'), size=128, required=True),
'date_de_naissance': fields.date(_(u'Date de naissance')),
'Etat_civile ': fields.selection([('celebataire','celebataire'),('marie','marie'),('devorce','devorcé'),('veuf','veuf')],string=_(u'Etat civile')),
'Genre': fields.selection([('homme','homme'),('femme','femme')],string=_(u'Genre')),
'numero_cin': fields.integer(_(u'numero cin')),
'adresse': fields.char(_(u'Adresse')),
'line_id': fields.one2many('documents.line', 'documents_id', string=_(u'Presentation de la famille')),
}
**************************
class documents(osv.Model):
_name = 'documents.line'
_description = u'Documents line class'
_columns = {
'documents_id': fields.many2one('documents', _(u'membrefamille')),
'nom_et_prenom': fields.char(_(u'Nom et prenom'),size=512),
'date_de_naissance': fields.date(_(u'Date de naissance')),
'parente': fields.char(_(u'Parente'),size=512),
'profession': fields.char(_(u'Profession'),size=512),
'niveau_etude': fields.char(_(u'Niveau d etude'), size = 512),
'remarques': fields.char(_(u'Remarque'),size=512),
'numero_telephone': fields.integer(_(u'Numero de telephone')),
}
********************
When I try to install it, I get this error:
Odoo Server Error
Traceback (most recent call last): File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\http.py", line 539, in _handle_exception File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\http.py", line 576, in dispatch File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\http.py", line 312, in _call_function File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\service\model.py", line 118, in wrapper File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\http.py", line 309, in checked_call File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\http.py", line 805, in __call__ File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\http.py", line 405, in response_wrap File "C:\Program Files\Odoo 8.0-20160315\server\openerp\addons\web\controllers\main.py", line 948, in call_button File "C:\Program Files\Odoo 8.0-20160315\server\openerp\addons\web\controllers\main.py", line 936, in _call_kw File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\api.py", line 268, in wrapper File "C:\Program Files\Odoo 8.0-20160315\server\openerp\addons\base\module\module.py", line 447, in button_immediate_install File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\api.py", line 268, in wrapper File "C:\Program Files\Odoo 8.0-20160315\server\openerp\addons\base\module\module.py", line 495, in _button_immediate_function File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\modules\registry.py", line 370, in new File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\modules\loading.py", line 355, in load_modules File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\modules\loading.py", line 255, in load_marked_modules File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\modules\loading.py", line 156, in load_module_graph File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\modules\registry.py", line 194, in setup_models File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\api.py", line 268, in wrapper File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\api.py", line 372, in old_api File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\models.py", line 3006, in _setup_fields File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\fields.py", line 470, in setup File "C:\Program Files\Odoo 8.0-20160315\server\.\openerp\fields.py", line 1770, in _setup_regular KeyError: 'documents_id'