Skip to content

Instantly share code, notes, and snippets.

View madprog's full-sized avatar

Paul Morelle madprog

  • Odoo
  • Ramillies, Belgium
View GitHub Profile
odoo.define('openerp_enterprise.BootstrapDialog', function (require) {
'use strict';
const {
Component,
hooks: { useRef },
misc: { Portal },
} = owl;
class BootstrapDialog extends Component {
@madprog
madprog / log_split.py
Created September 11, 2019 16:30
Odoo log splitter
import os
import sys
import time
def split_files(path):
path_dir = os.path.join(os.path.dirname(path), 'extracted_' + time.asctime())
if not os.path.exists(path_dir):
os.mkdir(path_dir)
quants = env['stock.quant'].search([])
move_line_ids = []
warning = ''
for quant in quants:
move_lines = env["stock.move.line"].search([
('product_id', '=', quant.product_id.id),
('location_id', '=', quant.location_id.id),
('lot_id', '=', quant.lot_id.id),
('package_id', '=', quant.package_id.id),
('owner_id', '=', quant.owner_id.id),
quants = env['stock.quant'].search([])
move_line_ids = []
warning = ''
for quant in quants:
move_lines = env["stock.move.line"].search([
('product_id', '=', quant.product_id.id),
('location_id', '=', quant.location_id.id),
('lot_id', '=', quant.lot_id.id),
('package_id', '=', quant.package_id.id),
@madprog
madprog / git-rebase-branches
Created April 3, 2019 14:08
Utility script which insert branch creation commands in a git rebase-TODO
#!/usr/bin/env python3
import os
import re
import subprocess as sp
import sys
def find_git_folder():
parts = os.getcwd().split(os.path.sep)
parts[0] = '/' # instead of ''
@madprog
madprog / my_tests.cpp
Created June 12, 2017 09:19
FakeIt segmentation fault
#include "tpunit++.hpp"
#include "fakeit.hpp"
using namespace fakeit;
struct MyTests : tpunit::TestFixture {
struct Wrapper {
virtual void open_file(const std::string &filename) const = 0;
};
using GI;
public void main(string[] args)
{
try {
string name = "mymodule";
Repository repository = Repository.get_default();
unowned Typelib module = repository.require_private(
Path.get_dirname(args[0]),
@madprog
madprog / install_salt.sh
Created June 9, 2015 16:23
Bootstrap and configure salt minion
#!/bin/sh
set -xe
master_hostname=bumblebee.htkc.org
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sudo sh install_salt.sh
sudo sh -c "echo 'master: $master_hostname' > /etc/salt/minion"
sudo service salt-minion restart
echo -n "\x1b[32m"
@madprog
madprog / gist:62428f92f17c3b9bc2cd
Created May 26, 2015 15:30
WhatColourIsIt (http://whatcolourisit.scn9a.org/) with a larger color space
<!DOCTYPE html><html><head><title>What colour is it?</title><meta charset="UTF-8" ><link href='http://fonts.googleapis.com/css?family=Open+Sans:800,400,300' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="http://scn9a.org/whatcolourisit/2.png">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
<meta name="description" content="what colour is it?"/>
<meta property="og:title" content="What colour is it?" />
<meta property='og:locale' content="en_GB"/>
<meta property='og:description' content="the time....... now in colour."/>
<meta property="og:type" content="Website" />
@madprog
madprog / Main.hx
Created March 25, 2015 09:40
Signal handling in haxe
package;
import tools.Signal;
class Main
{
public static function main():Void
{
var isRunning:Bool = true;