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

openerp 7 .netsvc: Unable to use a closed cursor.

By
priyankahdp
on 7/2/13, 8:17 AM 2,066 views

I need to add hr.employee many2one field for res.users model class.so i added the below lines.

    'employee': fields.boolean('Is Employee'),
    'employee_id' : fields.many2one('hr.employee', 'Employee'),

when i entered first line its worked perfectly and not gives a error. but when i added the second many2one filed then openerp gives a error like below please help me to sort out this issue

thanks..

    2013-07-02 15:40:05,775 14741 WARNING ? openerp.sql_db: Cursor not closed explicitly
Please enable sql debugging to trace the caller.
2013-07-02 15:40:05,779 14741 INFO ? werkzeug: 127.0.0.1 - - [02/Jul/2013 15:40:05] "POST /web/database/create HTTP/1.1" 200 -
2013-07-02 15:40:06,049 14741 INFO ? werkzeug: 127.0.0.1 - - [02/Jul/2013 15:40:06] "GET /web/static/src/img/warning.png HTTP/1.1" 304 -
2013-07-02 15:40:06,071 14741 INFO ? werkzeug: 127.0.0.1 - - [02/Jul/2013 15:40:06] "GET /web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png HTTP/1.1" 304 -
2013-07-02 15:40:11,160 14741 INFO ? openerp.service.web_services: Create database `hrmgtn`.
2013-07-02 15:40:11,161 14741 WARNING ? openerp.sql_db: ConnectionPool(used=0/count=1/max=64): Free leaked connection to 'user=priyan dbname=postgres'
2013-07-02 15:40:15,720 14741 INFO hrmgtn openerp.modules.loading: loading 1 modules...
2013-07-02 15:40:15,754 14741 INFO hrmgtn openerp.modules.module: module base: creating or updating database tables
2013-07-02 15:40:18,587 14741 INFO hrmgtn openerp.osv.orm: Computing parent left and right for table ir_ui_menu...
2013-07-02 15:40:30,708 14741 INFO hrmgtn openerp.osv.orm: Computing parent left and right for table res_partner_category...
2013-07-02 15:40:34,638 14741 ERROR hrmgtn openerp.service.web_services: CREATE DATABASE failed:
Traceback (most recent call last):
  File "/home/priyan/Softwares/openerp-7.0/openerp/service/web_services.py", line 76, in _initialize_db
    update_module=True)[1]
  File "/home/priyan/Softwares/openerp-7.0/openerp/pooler.py", line 39, in restart_pool
    registry = RegistryManager.new(db_name, force_demo, status, update_module)
  File "/home/priyan/Softwares/openerp-7.0/openerp/modules/registry.py", line 218, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/priyan/Softwares/openerp-7.0/openerp/modules/loading.py", line 304, in load_modules
    loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=update_module, report=report)
  File "/home/priyan/Softwares/openerp-7.0/openerp/modules/loading.py", line 168, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/home/priyan/Softwares/openerp-7.0/openerp/modules/module.py", line 374, in init_module_models
    result = obj._auto_init(cr, {'module': module_name})
  File "/home/priyan/Softwares/openerp-7.0/openerp/osv/orm.py", line 3182, in _auto_init
    raise except_orm('Programming Error', 'There is no reference available for %s' % (f._obj,))
except_orm: ('Programming Error', 'There is no reference available for hr.employee')
2013-07-02 15:40:34,642 14741 ERROR hrmgtn openerp.netsvc: Unable to use a closed cursor.
Traceback (most recent call last):
  File "/home/priyan/Softwares/openerp-7.0/openerp/netsvc.py", line 293, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/priyan/Softwares/openerp-7.0/openerp/service/web_services.py", line 122, in dispatch
    return fn(*params)
  File "/home/priyan/Softwares/openerp-7.0/openerp/service/web_services.py", line 168, in exp_create_database
    _initialize_db(self, id, db_name, demo, lang, user_password)
  File "/home/priyan/Softwares/openerp-7.0/openerp/service/web_services.py", line 98, in _initialize_db
    cr.close()
  File "/home/priyan/Softwares/openerp-7.0/openerp/sql_db.py", line 160, in wrapper
    raise psycopg2.OperationalError(msg)
OperationalError: Unable to use a closed cursor.
2013-07-02 15:40:34,646 14741 INFO hrmgtn werkzeug: 127.0.0.1 - - [02/Jul/2013 15:40:34] "POST /web/database/create HTTP/1.1" 200 -

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

0 follower(s)

Stats

Asked: 7/2/13, 8:17 AM
Seen: 2066 times
Last updated: 3/16/15, 8:10 AM