{"id":208,"date":"2019-04-13T15:11:55","date_gmt":"2019-04-13T14:11:55","guid":{"rendered":"http:\/\/blog.brunocsmartin.fr\/?p=208"},"modified":"2019-06-16T10:59:36","modified_gmt":"2019-06-16T09:59:36","slug":"odoo-dolibar-and-other","status":"publish","type":"post","link":"https:\/\/blog.brunocsmartin.fr\/index.php\/2019\/04\/13\/odoo-dolibar-and-other\/","title":{"rendered":"Odoo"},"content":{"rendered":"<p>Odoo on CentOS 7 : https:\/\/www.rosehosting.com\/blog\/install-odoo-12-on-centos-7\/<\/p>\n<p>or official one : <a href=\"https:\/\/www.odoo.com\/documentation\/12.0\/setup\/install.html#fetch-the-sources\">https:\/\/www.odoo.com\/documentation\/12.0\/setup\/install.html#fetch-the-sources<\/a><\/p>\n<p>Don&rsquo;t forget &#8211;depth 1 (otherwise : 2.3 GB, :-))<\/p>\n<p>for os x, install postgres app, add bin directory to path in bash profile :<\/p>\n<pre>export PATH=\"\/Applications\/Postgres.app\/Contents\/Versions\/latest\/bin:$PATH\"\r\n<\/pre>\n<p>If os x Mojave, install header for zlib with this command :<\/p>\n<pre>sudo installer -pkg \/Library\/Developer\/CommandLineTools\/Packages\/macOS_SDK_headers_for_macOS_10.14.pkg -target \/\r\n<\/pre>\n<p>For dev :<\/p>\n<p>create a base module:<\/p>\n<pre>.\/odoo-bin scaffold mymodule ..\/odoo-modules\/<\/pre>\n<p>install watchdog to auto update on code update<\/p>\n<pre>pip3 install watchdog<\/pre>\n<p>start server with external modules and development tools, -u mymodule is for update mymodule in development before start.<\/p>\n<pre>.\/odoo-bin --addons-path=addons,..\/odoo-modules\/ --db-filter=odoo --dev=reload -u mymodule<\/pre>\n<p>follow odoo install from <a href=\"https:\/\/linuxize.com\/post\/how-to-deploy-odoo-12-on-ubuntu-18-04\/\">https:\/\/linuxize.com\/post\/how-to-deploy-odoo-12-on-ubuntu-18-04\/<\/a><\/p>\n<p>sudo yum install rh-python36\u00a0rh-python36-python-devel\u00a0git gcc wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel<\/p>\n<p>for long polling and, thus, chat : add the line to \/etc\/odoo.conf<\/p>\n<pre>workers = 2<\/pre>\n<p>add service file for systemd<\/p>\n<pre>cat \/etc\/systemd\/system\/odoo12.service\r\n[Unit]\r\nDescription=Odoo12\r\nRequires=postgresql.service\r\nAfter=network.target postgresql.service\r\n\r\n[Service]\r\nType=simple\r\nSyslogIdentifier=odoo12\r\nPermissionsStartOnly=true\r\nUser=odoo12\r\nGroup=odoo12\r\nExecStart=\/opt\/odoo12\/odoo-venv\/bin\/python3 \/opt\/odoo12\/odoo\/odoo-bin -c \/etc\/odoo12.conf\r\nStandardOutput=journal+console\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>add service and nginx configuration<\/p>\n<pre>cat \/etc\/nginx\/sites-enabled\/example.com\r\n\r\n# Odoo servers\r\nupstream odoo {\r\nserver 127.0.0.1:8069;\r\n}\r\n\r\nupstream odoochat {\r\nserver 127.0.0.1:8072;\r\n}\r\n\r\n# HTTP -&gt; HTTPS\r\nserver {\r\nlisten 80;\r\nserver_name www.example.com example.com;\r\n\r\ninclude snippets\/letsencrypt.conf;\r\nreturn 301 https:\/\/example.com$request_uri;\r\n}\r\n\r\n# WWW -&gt; NON WWW\r\nserver {\r\nlisten 443 ssl http2;\r\nserver_name www.example.com;\r\n\r\nssl_certificate \/etc\/letsencrypt\/live\/example.com\/fullchain.pem;\r\nssl_certificate_key \/etc\/letsencrypt\/live\/example.com\/privkey.pem;\r\nssl_trusted_certificate \/etc\/letsencrypt\/live\/example.com\/chain.pem;\r\ninclude snippets\/ssl.conf;\r\n\r\nreturn 301 https:\/\/example.com$request_uri;\r\n}\r\n\r\nserver {\r\nlisten 443 ssl http2;\r\nserver_name example.com;\r\n\r\nproxy_read_timeout 720s;\r\nproxy_connect_timeout 720s;\r\nproxy_send_timeout 720s;\r\n\r\n# Proxy headers\r\nproxy_set_header X-Forwarded-Host $host;\r\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\nproxy_set_header X-Forwarded-Proto $scheme;\r\nproxy_set_header X-Real-IP $remote_addr;\r\n\r\n# SSL parameters\r\nssl_certificate \/etc\/letsencrypt\/live\/example.com\/fullchain.pem;\r\nssl_certificate_key \/etc\/letsencrypt\/live\/example.com\/privkey.pem;\r\nssl_trusted_certificate \/etc\/letsencrypt\/live\/example.com\/chain.pem;\r\ninclude snippets\/ssl.conf;\r\n\r\n# log files\r\naccess_log \/var\/log\/nginx\/odoo.access.log;\r\nerror_log \/var\/log\/nginx\/odoo.error.log;\r\n\r\n# Handle longpoll requests\r\nlocation \/longpolling {\r\nproxy_pass http:\/\/odoochat;\r\n}\r\n\r\n# Handle \/ requests\r\nlocation \/ {\r\nproxy_redirect off;\r\nproxy_pass http:\/\/odoo;\r\n}\r\n\r\n# Cache static files\r\nlocation ~* \/web\/static\/ {\r\nproxy_cache_valid 200 90m;\r\nproxy_buffering on;\r\nexpires 864000;\r\nproxy_pass http:\/\/odoo;\r\n}\r\n\r\n# Gzip\r\ngzip_types text\/css text\/less text\/plain text\/xml application\/xml application\/json application\/javascript;\r\ngzip on;\r\n}\r\n\r\n<\/pre>\n<p>Selenium and chromedriver<\/p>\n<p>on CentOS : install chromedriver and chromium browser and chromium headless, can be launched as root with &#8211;no-sandbox option<\/p>\n<p>pip install selenium<\/p>\n<p>example python script :<\/p>\n<pre>import time\r\nfrom selenium import webdriver\r\nfrom selenium.webdriver.chrome.options import Options\r\noptions = Options()\r\noptions.headless = True\r\noptions.add_argument('--no-sandbox')\r\nchrome_driver_binary = \"chromedriver\"\r\ndriver = webdriver.Chrome(chrome_driver_binary, chrome_options=options)\r\ndriver.get('http:\/\/www.google.com\/xhtml');\r\n#time.sleep(5) # Let the user actually see something!\r\nsearch_box = driver.find_element_by_name('q')\r\nsearch_box.send_keys('ChromeDriver')\r\nsearch_box.submit()\r\n#time.sleep(5) # Let the user actually see something!\r\ndriver.quit()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Odoo on CentOS 7 : https:\/\/www.rosehosting.com\/blog\/install-odoo-12-on-centos-7\/ or official one : https:\/\/www.odoo.com\/documentation\/12.0\/setup\/install.html#fetch-the-sources Don&rsquo;t forget &#8211;depth 1 (otherwise : 2.3 GB, :-)) for os x, install postgres app, add bin directory to path in bash profile : export PATH=\u00a0\u00bb\/Applications\/Postgres.app\/Contents\/Versions\/latest\/bin:$PATH\u00a0\u00bb If os x Mojave, install header for zlib with this command : sudo installer -pkg \/Library\/Developer\/CommandLineTools\/Packages\/macOS_SDK_headers_for_macOS_10.14.pkg -target \/ &hellip; <a href=\"https:\/\/blog.brunocsmartin.fr\/index.php\/2019\/04\/13\/odoo-dolibar-and-other\/\" class=\"more-link\">Continuer la lecture de <span class=\"screen-reader-text\">Odoo<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-208","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts\/208"}],"collection":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/comments?post=208"}],"version-history":[{"count":14,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts\/208\/revisions"}],"predecessor-version":[{"id":241,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/posts\/208\/revisions\/241"}],"wp:attachment":[{"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/media?parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/categories?post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.brunocsmartin.fr\/index.php\/wp-json\/wp\/v2\/tags?post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}