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

Error on loading openerp with custom module

By
Houssem
on 4/26/14, 4:09 PM 1,286 views

Hello every one, i created a new module depends on project management for adding new fields and this is the code

from osv import osv, fields

class res_projet(osv.osv): """ Proyecto """ _inherit = 'project.project'

_columns = {
    'budgetTrans': fields.float('Budget transferable'),
    'budgetNonTrans': fields.float('Budget non transferable'),
    'typeProjet': fields.selection((('i','IP'), ('d','Data'), ('t','Transmission'), ('af','fixe'), ('am','mobile'), ('gf','fibre')),'Type de projet'),
    'PO': fields.char('N PO',size=10,required='1'),
    'AO': fields.char('N marche',size=10,required='1'),
    'phase': fields.char('phase',size=10,readonly=True)
}

res_projet()

when i restart service and loading openerp i have this msg:

Client Traceback (most recent call last): File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 180, in dispatch File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 466, in authenticate File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\session.py", line 73, in authenticate File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 117, in proxy File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 611, in send

Server Traceback (most recent call last): File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 592, in send File "C:\Program Files\OpenERP 6.1-1\server.\openerp\netsvc.py", line 360, in dispatch_rpc File "C:\Program Files\OpenERP 6.1-1\server.\openerp\service\web_services.py", line 384, in dispatch File "C:\Program Files\OpenERP 6.1-1\server.\openerp\service\web_services.py", line 395, in exp_authenticate File "C:\Program Files\OpenERP 6.1-1\server.\openerp\pooler.py", line 50, in get_pool File "C:\Program Files\OpenERP 6.1-1\server.\openerp\pooler.py", line 33, in get_db_and_pool File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\registry.py", line 138, in get File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\registry.py", line 160, in new File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\loading.py", line 334, in load_modules File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\loading.py", line 253, in load_marked_modules File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\loading.py", line 167, in load_module_graph File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\registry.py", line 97, in load File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 875, in create_instance AttributeError: 'NoneType' object has no attribute '_name'

0
Houssem
On 4/26/14, 5:21 PM

i tried to delete and creating a new database, every think work. But when i install my custom module and restarting the service i recive this error: NoneType' object has no attribute '_name'

code _openerp_.py:

{ 'name': "Module Project management pour Tunisie Telecom", 'category': 'Base', 'description': """ [ENG] Add automatic partner sequence on ref field [ITA] Aggiunge la sequenza automatica nel campo rif del partner """, 'author': 'Houssem', 'website': 'toto', 'license': 'AGPL-3', "depends" : ['base,project'], "init_xml" : [], "update_xml" : [], "demo_xml" : [], "active": False, "installable": True }

resprojet.py

from osv import osv, fields

class resprojet(osv.osv):

_inherit = 'project.project'

_columns = {
    'budgetTrans': fields.float('Budget transferable'),
    'budgetNonTrans': fields.float('Budget non transferable'),
    'typeProjet': fields.selection((('i','IP'), ('d','Data'), ('t','Transmission'), ('af','fixe'), ('am','mobile'), ('gf','fibre')),'Type de projet'),
    'PO': fields.char('N PO',size=10,required='1'),
    'AO': fields.char('N marche',size=10,required='1'),
    'phase': fields.char('phase',size=10,readonly=True)
}

resprojet()

init.py

import resprojetTunisieTelecom

i18n/it.po

Translation of OpenERP Server.

This file contains the translation of the following modules:

* partner_sequence

# msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-06-03 13:36+0000\n" "PO-Revision-Date: 2013-06-03 13:36+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n"

#. module: resprojet #: model:ir.model,name:resprojet.model_project_project msgid "Project" msgstr "Project"

#. module: resprojet #: sql_constraint:res.partner:0 msgid "The reference must be unique" msgstr "Il riferimento deve essere unico"

#. module: resprojet #: code:addons/resprojet/resprojet.py:62 #, python-format msgid "-copy" msgstr "-copia"

0
Gustavo
On 4/26/14, 4:25 PM

I don't think your module is the problem. Try restarting the server on debug mode (--debug flag) without loading the module and see if the same error happens again. Chances are, there is something wrong with a different module

how can i start the server on debug mode, i'm sorry but i'm beginner with openerp i'm using windows 8 and openerp 6.1

Houssem
on 4/26/14, 4:37 PM
0
samir
On 5/28/14, 12:53 PM

fields.selection syntax is not correct 

exemple : 

        'my_field': fields.selection([ ('selec1','Selection 1'), ('selec2','Selection 2'), ],'Name'),

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

1 follower(s)

Stats

Asked: 4/26/14, 4:09 PM
Seen: 1286 times
Last updated: 3/16/15, 8:10 AM