Showing posts with label Odoo-9. Show all posts
Showing posts with label Odoo-9. Show all posts

Tuesday, June 18, 2019

Odoo 9 screen is blank

Issue: 



Solution:

I have found discussion on https://github.com/odoo/odoo/issues/19627 , seems that this issue was known. I tried the workaround to delete the assets information belong in /web/content

DELETE FROM ir_attachment WHERE url LIKE '/web/content/%';

but the first try wasn't successful, so i tried restart the service and refresh my browser.

Still not okay the second, third ... etc. I can't remember how many times i tried but at last it worked.



It's weird but I'm happy as for now. Eureka!

Wednesday, April 24, 2019

File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_attachment.py"








Conclusion:

Was able to fix this problem with a workaround: manually going into the database and removing the entries pointing to the missing files from filestoreDELETE FROM ir_attachment WHERE store_fname LIKE '%<the ending hash>%'


reference:
https://www.odoo.com/es_ES/forum/ayuda-1/question/solved-how-to-recover-deleted-attachment-files-from-filestore-folder-local-share-odoo-filestore-128453

Thursday, January 24, 2019

Error: Permission denied to access property "nodeName"

issue




https://github.com/odoo/odoo/commit/5bb7ffa2

1. copy the file from container to host
docker cp 12f4057cbf0c:/usr/lib/python2.7/dist-packages/openerp/addons/web_editor/static/src/js/summernote.js .

2. after edit the file, copy back to container
docker cp summernote.js 12f4057cbf0c:/usr/lib/python2.7/dist-packages/openerp/addons/web_editor/static/src/js






Eureka!

Wednesday, November 14, 2018

Odoo Warning - Validation Error


Problem:
































Solution: None
it turns out that the problem was the trigger. our DB admin created trigger :(

Monday, September 3, 2018

Wednesday, March 21, 2018

Inheriting a view without overriding the original view

the solution is to add

<field name="mode">primary</field> 
that's it! I don't know who created odoo but it's hard to get the right answer because of less documentation.


https://www.odoo.com/forum/help-1/question/inheriting-a-view-without-overriding-the-original-view-solved-85762

Saturday, January 27, 2018

How to change report.pdf in Odoo


from Delivery Report.pdf to PO00001.pdf



class report_controller(main.ReportController):
        @http.route(['/report/download'], type='http', auth="user")
        def report_download(self, data, token):
            order_obj = http.request.env['stock.picking']
            normalize_obj = unicodedata.normalize('NFKD', data).encode('ascii','ignore')
            if 'delivery_report' in normalize_obj:
                reportname = normalize_obj.split('/report/pdf/')[1].split('?')[0]
                reportname, docids = reportname.split('/')
                assert docids
                object = order_obj.browse(int(docids))
                response = super(report_controller, self).report_download(data, token)
                response.headers.set('Content-Disposition', 'attachment; filename=%s.pdf;' % object.origin)
                return response


fixed bug:
pls see on red

Reference:

Friday, January 12, 2018

Print output does not reflecting in the log

It took me a couple of days just to figure out this problem. I know its a simple as you think but I'm wondering why can't show the print output in the log.

For many test attempt that I have done, I finally figure it out.

Simple.

environment:
      - PYTHONUNBUFFERED=1

that's it, just add this to docker-compose yml file.
Eureka!

Monday, November 27, 2017

Odoo API



How to find name of database for XML-RPC connection to OpenERP/Odoo?

db_serv_url = 'http://{}/xmlrpc/db'.format(host)
sock = xmlrpclib.ServerProxy(db_serv_url)
dbs = sock.list()
print dbs



Thursday, March 30, 2017

Install Odoo 9 and Postgresql 9.3 inside docker container

Currently I'm working on a Odoo application where we installed our development environment in the Ubuntu/VMware. Apparently, I also like to know how to install the same setup using docker container and I tell you its not easy but luckily after few trial, here's my command that works perfectly.


1. Install postgres 9.3 with username = admin and password = admin. Port is default 5432 and the name of the container is postgres9.3, its makes sense. I'm not sure what is the --restart=always attribute but we can just leave that as is it.

docker run -d -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=admin --name postgres9.3 -p 5432:5432 --restart=always postgres:9.3


2. Install Odoo 9 with default port 8069. The container name is odoo9 and its link with the postgres installed as above. That's it, very simple but it took me a while to figure it out. I'm still not an expert devops.

docker run -p 8069:8069 --name odoo9 --link postgres9.3:db -t odoo:9


mount custom addons
docker run -v /dev_path/svn/repo2/trunk:/mnt/extra-addons -p 8069:8069 --name vbroker --link postgres9.3:db -t ls/odoo9



Updated:
Everything works fine on the above setup however when I launch my code , it shows warning that need to install pika module. So I decided to get the Dockerfile from official odoo 9 installation from github. https://hub.docker.com/_/odoo/



build again using below command
$docker build -t <name> .

Eureka!

Wednesday, March 29, 2017

Odoo 9 Installation guideline

First thing of advice, when running odoo in vmware where ubuntu is installed as operating system. Configure the harddisk around 40gb and the memory at 3gb to get most optimize one. 

#apply any patches and make sure your Ubuntu server is accessing the Internet

sudo apt-get update
sudo apt-get dist-upgrade

#reboot your server

sudo reboot

#install postgres

sudo apt-get install postgresql

#change over to the postgresql to set permissions on our development user

sudo su - postgres
createuser --createdb --username postgres --no-createrole --pwprompt devlynard

#python dependencies

sudo apt-get install python-cups python-dateutil python-decorator python-docutils python-feedparser
sudo apt-get install python-gdata python-geoip python-gevent python-imaging python-jinja2 python-ldap
sudo apt-get install python-libxslt1 python-lxml python-mako python-mock python-openid python-passlib
sudo apt-get install python-psutil python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing
sudo apt-get install python-pypdf python-reportlab python-requests python-simplejson python-tz python-unicodecsv
sudo apt-get install python-unittest2 python-vatnumber python-vobject
sudo apt-get install python-werkzeug python-xlwt python-yaml wkhtmltopdf
sudo apt-get install python-pip python-dev libevent-dev gcc libxml2-dev libxslt-dev node-less geoip-database-contrib
sudo apt-get install python-pip git-core
sudo pip install pika

#install git

sudo apt-get install git

#download odoo framework

git clone https://www.github.com/odoo/odoo --depth 1 --branch 9.0 --single-branch .

#Linux file sharing services compatible with Microsoft

sudo apt-get install samba samba-common-bin
sudo smbpasswd -a odoo
sudo nano /etc/samba/smb.conf

[homes]
comment = Home Directories
browseable = yes
read only = no
create mask = 0640
directory mask = 0750

sudo /etc/init.d/smbd restart


#Install subversion on Ubuntu

sudo apt-get install subversion
svn co --username <username> svn://172.18.6.230/repo2
sudo dpkg -l|grep subversion
svn –version
svn update

#to install rabbitvcs

sudo add-apt-repository ppa:rabbitvcs/ppa
sudo apt-get update
sudo apt-get install rabbitvcs-nautilus3



#installing PIP And PyPDF2 To Read PDF File With Python On Ubuntu Linux

sudo apt-get update
sudo apt-get -y install python-pip
pip --help
sudo pip install PyPDF2



#install pycharm in ubuntu

Download Pycharm
https://www.jetbrains.com/pycharm/download/#section=linux

Copy the pycharm-*.tar.gz to an empty directory
(make sure you have rw permissions for that directory)

Unpack the pycharm-*.tar.gz using the following command:

tar xfz pycharm-*.tar.gz

Remove the pycharm-*.tar.gz to save disk space (optional)
Run pycharm.sh from the bin subdirectory

NOTE: PyCharm on Linux doesn't need special installation or running any installation script. It runs out of the pycharm-*.tar.gz




#additional libraries

sudo apt-get install python-pip

sudo apt-get install python-yaml
pip install pytz
sudo pip install python-dateutil
sudo pip install tzlocal   


free online comma separating tool

https://delim.co/#