Skip to content

Instantly share code, notes, and snippets.

View kryskool's full-sized avatar

Christophe CHAUVET kryskool

View GitHub Profile
@kryskool
kryskool / display_address_001.sql
Created March 30, 2018 09:13
Fonction display_address() avec 2 paramètres
--
-- Fonction à 2 paramètres, n'affichera pas le nom de la société car cet arguemnt en python est à False
--
CREATE OR REPLACE FUNCTION display_address(t_country_id INTEGER, t_address_id INTEGER)
RETURNS TEXT AS
$BODY$
DECLARE
r RECORD;
@kryskool
kryskool / profile_view_load
Created February 5, 2018 14:20 — forked from hbrunn/profile_view_load
profile_view_load
#!/usr/bin/env python2
from argparse import ArgumentParser
parser = ArgumentParser(
description='Profile loading a model\'s data for a specific view in order '
'to find bottlenecks')
parser.add_argument('odoo_basedir')
parser.add_argument('odoo_cfg')
parser.add_argument('odoo_db')
@kryskool
kryskool / gist:8aff3058639a40e9a281
Created October 31, 2014 09:57
[PATCH] tools: remove useless attributes
---
server/openerp/tools/safe_eval.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/server/openerp/tools/safe_eval.py b/server/openerp/tools/safe_eval.py
index b99de38..7ac3b51 100644
--- a/server/openerp/tools/safe_eval.py
+++ b/server/openerp/tools/safe_eval.py
@@ -220,8 +220,6 @@ def safe_eval(expr, globals_dict=None, locals_dict=None, mode="eval", nocopy=Fal
'False': False,
@kryskool
kryskool / gist:5704515
Created June 4, 2013 08:36
generate a header for file with fixed length
header = ''
max_lenght = 100
for x in range(1, max_lenght):
if not x % 10 :
header += '|'
elif not x % 5:
header += '.'
else:
header += ' '
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# smtp_tools module for OpenERP, SMTP to file for test
# Copyright (C) 2010 SYLEAM (<http://www.syleam.fr/>)
# Christophe CHAUVET <[email protected]>
#
# This file is a part of smtp_tools
#
@kryskool
kryskool / backup_db.sh
Created September 26, 2012 07:29 — forked from matrixise/backup_db.sh
Backup all the OpenERP databases and the associated filestores
#!/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')"`
@kryskool
kryskool / gist:2021962
Created March 12, 2012 13:36
PS1 for Git
BLUE1="\[\033[0;34m\]"
BLUE2="\[\033[1;34m\]"
GREY1="\[\033[0;37m\]"
GREY2="\[\033[1;30m\]"
GREEN1="\[\033[0;32m\]"
GREEN2="\[\033[1;32m\]"
YELLOW1="\[\033[1;33m\]"
RED1="\[\033[0;31m\]"
RED2="\[\033[1;31m\]"
WHITE1="\[\033[1;37m\]"
@kryskool
kryskool / skype-call-handler
Created March 7, 2012 17:15
Script to use Skype with DBus
#!/bin/sh
SKYPE="skype"
DBUS_SEND="dbus-send"
BUS="--system"
SKYPE_BUS=""
ID=`id -u`
print_help()
{