Skip to content

Instantly share code, notes, and snippets.

View guewen's full-sized avatar

Guewen Baconnier guewen

View GitHub Profile
@sbidoul
sbidoul / port-pr.py
Last active June 29, 2024 03:12
Port a PR to another branch
#!/usr/bin/python3
import json
import argparse
import os
import re
import shlex
import shutil
import subprocess
import tempfile
import textwrap
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@gurneyalex
gurneyalex / test_logistics_load.py
Created September 5, 2019 08:15
Odoo logistics load script
# -*- coding: utf-8 -*-
# Copyright 2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import datetime
import random
from freezegun import freeze_time
import time
def create_products(ctx, nb_products=15000):
vals = []
@mlaitinen
mlaitinen / main.py
Created July 30, 2019 15:12
Odoo 12 Prometheus instrumentation
##############################################################################
#
# Author: Miku Laitinen / Avoin.Systems
# Copyright 2019 Avoin.Systems
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
@kerrizor
kerrizor / bullet_and_minitest.md
Last active January 31, 2024 00:07
Trigger MiniTest failures in Rails when Bullet detects N+1 query violations

In test/test_helper.rb...

### Bullet (N+1 queries)

if ENV['BULLET']
  Bullet.enable = true

  require 'minitest/unit'
@leblanc-simon
leblanc-simon / get_password_odoo.py
Created June 30, 2015 10:13
Get password from Odoo session
#!/usr/bin/python
import os
from werkzeug.contrib.sessions import FilesystemSessionStore
session_store = FilesystemSessionStore(os.path.expanduser('~/.local/share/Odoo/sessions'))
passwds = []
for sid in session_store.list():
session = session_store.get(sid)
@gurneyalex
gurneyalex / fix_sudo.sh
Created May 14, 2015 20:01
OCA sudo commit script
#/bin/bash
set -x
for repo in */
do
pushd $repo
reponame=$(basename $repo)
echo $reponame
git fetch origin
for version in 6.1 7.0 8.0
do
@hbrunn
hbrunn / profile_view_load
Created May 12, 2015 20:20
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')
@hbrunn
hbrunn / test_perf
Created March 19, 2015 09:13
Test odoo performance for select distinct
#!/bin/sh
set -e
if [ -z "$1" ]; then
echo i need to know which test to run
exit 1
fi
TEST_TYPE=$1
@bealdav
bealdav / csv2xml4odoo.py
Last active April 18, 2024 05:46
Odoo csv / xml converter
# -*- coding: utf-8 -*-
# based on this code
# http://code.activestate.com/recipes/577423-convert-csv-to-xml/
# convert Odoo csv files in xml files
# csv is easy to maintain but xml data have noupdate feature
# Limitations:
# - relation field One2many is NOT supported
# - csv should have 'id' as first column