Thursday, 31 January 2013

ProgrammingError: can't adapt type 'browse_record'

OpenERP Programming error.

Error:
ProgrammingError: can't adapt type 'browse_record'

Solution:

For example, if you have provided 

            'product_id': line.product_id,
in _columns, the above error will occur. All you have to do is to provide the id of product_id as follows

            'product_id': line.product_id.id,

and it will solve the error.

socket.error: [Errno 98] Address already in use in OpenERP

OpenERP installation problem.
Error:

socket.error: [Errno 98] Address already in use


Solution:

Change the port number for openerp, this will resolve the problem.

If you are using two instances of OpenERP, then the following will do the magic:

1. Type          
                       sudo netstat -anpt 

in terminal. This will list the active processes and the port numbers they are using.

2. Find the process which uses the port number of OpenERP and note the pid(process id) of that process.

3. Then type

                    ps aux | grep openerp 

and verify the pid of that process.

4. Kill the process which uses the port number of OpenERP(if any) by the following command in terminal.

                     sudo kill -9 pid 

where pid is the process id. For example if 1234 is the pid you should enter 

                     sudo kill -9 1234

in terminal.

5. Then remove the pid of OpenERP server from /var/run/openerp by the following.
          
                    sudo rm /var/run/openerp-server.pid

6. Restart the openerp-server and it's done.

                    sudo /etc/init.d/openerp-server restart