Skip to content

Instantly share code, notes, and snippets.

View ilyasProgrammer's full-sized avatar

Ilyas ilyasProgrammer

  • Sindelfingen
View GitHub Profile
@ilyasProgrammer
ilyasProgrammer / barcode
Created March 6, 2021 15:11
Barcode scanner output simulation
sleep 5; xdotool type "001122334455"
@ilyasProgrammer
ilyasProgrammer / wkhtmltopdf.sh
Created January 27, 2021 17:34 — forked from faniska/wkhtmltopdf.sh
Install wkhtmltopdf with patched QT on Ubuntu Linux
# Uncomment the next line if you have installed wkhtmltopdf
# sudo apt remove wkhtmltopdf
cd ~
# Select an appropriate link for your system (32 or 64 bit) from the page https://wkhtmltopdf.org/downloads.html and past to the next line
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox*.tar.xz
sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin
sudo apt-get install -y openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig

Odoo - Rename an addon without losing data

Rename addon

  • Change __openerp__.py addon name field
  • Change README.rst file
@ilyasProgrammer
ilyasProgrammer / odoo_shell.py
Last active March 9, 2024 18:11
Uninstall Odoo module from shell
python3 /pd/odoo13ee/odoo-bin shell -d database_name
self.env['ir.module.module'].search([('name', '=', 'module_name')]).button_immediate_uninstall()
@ilyasProgrammer
ilyasProgrammer / ext_id.xml
Last active April 25, 2019 19:15
Odoo add xml identifier to modify record via xml
<!-- Trick to bind to record created with UI -->
<record id="amz_warehouse_to_fba_ext_id" model="ir.model.data">
<field name="res_id">10</field>
<field name="model">stock.picking.type</field>
<field name="module">sale_store_amazon</field>
<field name="name">amz_warehouse_to_fba</field>
<field name="noupdate">False</field>
</record>
<record id="amz_warehouse_to_fba" model="stock.picking.type">
<field name="name">Ama A</field>
@ilyasProgrammer
ilyasProgrammer / xml_rpc.py
Created November 12, 2017 16:28
Odoo xml rpc example
import xmlrpclib
from datetime import datetime
# url = "http://localhost:8069"
# db = "RAJO"
# username = 'a'
# password = 'a'
url = "https://erp.atlantis-kw.com"
db = "RAJO_TEST"
username = 'api'
@ilyasProgrammer
ilyasProgrammer / openbox.sh
Created October 25, 2017 14:46
Openbox tips
Tint2 tray volume control: https://packages.debian.org/search?keywords=volumeicon
@ilyasProgrammer
ilyasProgrammer / install.sh
Last active October 25, 2017 09:52
odoo install problems: ldap lxml an other issues
apt-get install libxml2-dev libxslt-dev
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
pip install --no-binary :all: psycopg2
pytopdf
install equivs to create fake packages and python-pipto install package from Python repository
run equivs-control python-pypdf, this will create and populate the file python-pypdf
edit the file like below (dot and space under "Description" are mandatory) :
@ilyasProgrammer
ilyasProgrammer / remote_dev.py
Last active March 23, 2020 14:12
Remote Debug Odoo in Pycharm Prof
On your remote server, run: pip install cython pydevd
IMPORTANT: Make sure that your computer is visible to server's IP by pinging your computer's IP
AND make port forwarding if necessary
Create debug folder localy using same path as on remote server. Necessary for correct break points work.
Connect remote content for debug:
sshfs bar:/srv/odoo /srv/odoo/
Use this path for mapping.
On your computer, configure a Python Remote Debug in run configurations.
@ilyasProgrammer
ilyasProgrammer / BaseModel.py
Created September 22, 2017 12:28
BaseModel methods replacement
class BaseModelExtend(models.AbstractModel):
_name = 'basemodel.extend'
models.BaseModel._navigation = 'id'
def _register_hook(self):
@api.multi
def _read_group_process_groupby(self, gb, query):
split = gb.split(':')
field_type = self._fields[split[0]].type
gb_function = split[1] if len(split) == 2 else None