Odoo Help

2

No module named psycopg2 !

By
fdim
on 5/23/13, 8:27 AM 2,204 views

I Have this error when i execute a onchange method :

No module named psycopg2

Here my on_change method :

def onchange_produit(self, cr, uid, ids, designation_produit, ref_produit, marque, context=None):
    if context is None:
        context = {}
        context['lang'] = self.pool.get('res.users').browse(cr,uid,uid).context_lang

    if designation_produit:
        formulprod = self.pool.get('mrp.bom').browse(cr, uid, designation_produit, context=context)
        v = {'ref_produit': formulprod.code, 'marque': formulprod.routing_id}
        return {'value': v}
    return {}

Help me plz

6

Sandeep

--Sandeep--
Sandeep
6083
| 6 5 8
Delhi, India
--Sandeep--
Python OpenERP Developer http://in.linkedin.com/pub/sandeep-rana/3b/a16/786/
Sandeep
On 5/23/13, 8:31 AM

hey fdlim

install psycopg2 module in python dist-package

if you are using linux then just

 sudo apt-get install python-psycopg2

from your system root:

Thanks
Sandeep

I have a new error :

fdim
on 5/23/13, 8:50 AM

OperationalError: Unable to use the cursor after having closed it

fdim
on 5/23/13, 8:51 AM
1

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10170
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 5/23/13, 8:53 AM

It seems psycopg2 is not installed in your system. First install psycopg2 and then run OpenERP server.

Command to install psycopg2:

sudo apt-get install python-psycopg2

or

sudo easy_install psycopg2

or

You can download latest package (tar.gz) from Download pysycopg2. After that extract it, open terminal and run setup.py file.

sudo python setup.py install

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

0 follower(s)

Stats

Asked: 5/23/13, 8:27 AM
Seen: 2204 times
Last updated: 3/16/15, 8:10 AM