Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
38825 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

I have a new error :

Tác giả

OperationalError: Unable to use the cursor after having closed it

Câu trả lời hay nhất

this working ...

sudo apt-get install libpq-dev

pip install psycopg2

sudo apt-get install build-dep python-psycopg2

pip3 install psycopg2



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
pip install psycopg2-binary

Please use above command it will useful for this

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
5894
2
thg 3 15
5026
0
thg 3 15
4240
1
thg 3 15
4525
0
thg 3 15
3689