Command | Format | Description |
---|---|---|
^A | ^Afo,h,w,d:f.x | Use Scalable/Bitmapped Font |
^A@ | ^A@o,h,w,d:f.x | Use Font Name to Call Font |
^B0 | ^B0a,b,c,d,e,f,g | Aztec Bar Code Parameters |
^B1 | ^B1o,e,h,f,g | Code 11 Bar Code |
^B2 | ^B2o,h,f,g,e,j | Interleaved 2 of 5 Bar Code |
^B3 | ^B3o,e,h,f,g | Code 39 Bar Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Using PIL add 'DEV' to the company (and the main odoo) logo | |
This is meant to be run as a script in the upgrade.py script of anybox.recipe.odoo | |
""" | |
from base64 import b64encode, b64decode | |
from cStringIO import StringIO | |
from PIL import Image, ImageDraw | |
main_partner = session.registry('ir.model.data').get_object( | |
session.cr, session.uid, 'base', 'main_partner') | |
if main_partner.image: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Setup: | |
Assuming Odoo 8.0 sources at ~/odoo: | |
$ cp odoo-sh.py ~/odoo | |
$ cd ~/odoo | |
$ python -i odoo-sh.py | |
Usage example: | |
>>> env = connect('my-db-name') | |
>>> Users = env['res.users'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import | |
import contextlib | |
__all__ = ['savepoint', 'create_missing_indexes'] | |
@contextlib.contextmanager | |
def savepoint(cr, name, quiet=False): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PORT=6432 | |
# Create a ramfs | |
if [ -f /tmp/pg_on_ram ] | |
then | |
echo "/tmp/pg_on_ram already exists" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a virtualenv; use system packages to make this faster | |
virtualenv --system-site-packages myopenerp | |
cd myopenerp | |
source bin/activate | |
# As an example, install OpenERP with the CRM App | |
pip install --extra-index-url https://googledrive.com/host/0Bz7bXY1bYyqJa2xUSmFVOUVySHc/simple openerp-crm | |
# Show installed server version | |
openerp-server --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import sys | |
import colorama | |
from colorama import Fore, Back, Style | |
LEVEL_COLOR_MAPPING = { | |
logging.DEBUG: Fore.BLUE + Back.RESET, | |
logging.INFO: Fore.GREEN + Back.RESET, | |
logging.WARNING: Fore.YELLOW + Back.RESET, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ROOT_BACKUP_PATH=/tmp/backup | |
echo "backup path: ${ROOT_BACKUP_PATH}" | |
# Create the backup directory | |
[ -d "$ROOT_BACKUP_PATH" ] || mkdir -p $ROOT_BACKUP_PATH | |
DATABASES=`psql -ltA -d postgres -c "SELECT datname FROM pg_database WHERE datname NOT IN ('postgres', 'template0', 'template1')"` |