Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Odoo ❤️ you, even if you don't pay their subscription

Ivan Kropotkin yelizariev

💭
Odoo ❤️ you, even if you don't pay their subscription
View GitHub Profile
@yelizariev
yelizariev / install-odoo.sh
Last active Dec 1, 2021
install odoo from source. Script is maintained on github now: https://github.com/yelizariev/install-odoo
View install-odoo.sh
if [ "$(basename $0)" = "install-odoo.sh" ]; then
echo "don't run install-odoo.sh, because it's not fully automated script. Copy, paste and execute commands from this file manually"
exit 0
fi
#### Detect type of system manager
export SYSTEM=''
pidof systemd && export SYSTEM='systemd'
View install-ivann-ssh.sh
#
su
# ivann + general
mkdir ~/.ssh
curl --silent https://github.com/yelizariev.keys | xargs echo -n >> ~/.ssh/authorized_keys
echo -ne " yelizariev@it-projects.info\n" >> ~/.ssh/authorized_keys
@yelizariev
yelizariev / edit-odoo-source.sh
Last active Aug 29, 2015
edit-odoo-source.sh
View edit-odoo-source.sh
cd /usr/local/src/odoo
## delete matches="..." at /web/database/manager
sed -i 's/matches="[^"]*"//g' addons/web/static/src/xml/base.xml
## disable im_odoo_support
sed -i "s/'auto_install': True/'auto_install': False/" addons/im_odoo_support/__openerp__.py
@yelizariev
yelizariev / 1-Ubuntu-odoo-development.sh
Last active Sep 6, 2019
Ubuntu configuration for odoo development
View 1-Ubuntu-odoo-development.sh
sudo apt-get update
sudo apt-get install git python-pip htop moreutils tree nginx gimp wmctrl postgresql-server-dev-all
sudo apt-get upgrade
################### Github
# configure ssh keys: https://help.github.com/articles/generating-ssh-keys/
################### Odoo
# download odoo from git:
cd /some/dir/
View 1-Docker-Runbot.sh
### instruction to run via docker
# install docker ( https://docs.docker.com/engine/installation/ubuntulinux/ )
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list # ubuntu 14.04
apt-get update
apt-get purge lxc-docker
apt-cache policy docker-engine
apt-get install linux-image-extra-$(uname -r) # ubuntu 14.04
apt-get install docker-engine
@yelizariev
yelizariev / 1-Constitution.md
Last active Feb 20, 2021
IT-Projects LLC rules. The document is moved to https://gitlab.com/itpp/handbook/
View 1-Constitution.md

Constitution explains how and in what direction is the company growing

I. Just work well

  • The only way to compensate poorly made work is to improve yourself and do it well

I.1. No penalties

  • There are no any financial, moral, administrative penalties

I.2. No excuses

  • Inside the company, excuses have no sense
@yelizariev
yelizariev / print-pdf-on-ticket-printer.md
Last active Nov 13, 2018
How-to print pdf on a ticket printer.
View print-pdf-on-ticket-printer.md

Instruction provided by @invitu

1- Install Cups on the posbox:

  • The posbox is a read-only system, you have to chroot it to install cups
  • Run a posbox on a raspberry-pi and plug a pen drive containing another posbox image
  • chroot the posbox in the pen drive
  • install cups with apt-get
  • plug the epson on the posbox
  • setup a Raw queue using usb://EPSON/TM-T20II in cups and share it (remove the "?serial=xxxxxxx" part if you want to use the image with another printer
  • there is no driver for epson printer for raspbian, that's the reason we must use raw queue
View bash prompt
# PS1 for remote root
# \t \h \w\$
export PS1='\[\033[00;31m\]\t \[\033[01;31m\]\h \[\033[01;34m\]\w\[\033[01;31m\]\$\[\033[00m\] '
# https://wiki.archlinux.org/index.php/Color_Bash_Prompt
@yelizariev
yelizariev / fix-travis.sh
Last active Dec 1, 2016
Script to fix lint travis errors on odoo. OBSOLETE. Latest version is here: https://odoo-development.readthedocs.io/en/latest/dev/lint/index.html
View fix-travis.sh
# fix line break symbols
find * -type f | grep -v ".\(svg\|png\|jpg\)$" | xargs sed -i 's/\r//g'
# trim trailing whitespaces
find * -type f | grep -v ".\(svg\|png\|jpg\)$" | xargs sed -i 's/[ \t]*$//g'
#PEP8 для py-файлов:
autopep8 --in-place -r --aggressive --aggressive --ignore E501 ./
# fix CamelCase
@yelizariev
yelizariev / new-api.sh
Last active Mar 17, 2017
Helpers for migrating to new odoo api (10.0+). Obsolete. Check for latest version here: https://odoo-development.readthedocs.io/en/latest/migration/index.html
View new-api.sh
# IMPORTS
# replace osv, orm
find . -type f -name '*.py' | xargs sed -i 's/from openerp.osv import orm$/from odoo import models/g'
find . -type f -name '*.py' | xargs sed -i 's/from openerp.models.orm import Model$/from odoo.models import Model/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.osv_memory/models.TransientModel/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.osv/models.Model/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.except_osv/UserError/g'
find . -type f -name '*.py' | xargs sed -i 's/osv\./models./g'
find . -type f -name '*.py' | xargs sed -i 's/\<orm\./models./g'
find . -type f -name '*.py' | xargs sed -i 's/\(import .*\), osv/\1, models/g'