This file contains hidden or 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 python3 | |
import argparse | |
import logging | |
import logging.config | |
import os | |
import sys | |
import yaml | |
from datetime import datetime | |
import requests |
This file contains hidden or 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 psycopg2 | |
import threading | |
import odoo | |
class BadVersion(Exception): | |
pass | |
class BadModuleState(Exception): | |
pass |
This file contains hidden or 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
############################################################################## | |
# | |
# 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. | |
# |
This file contains hidden or 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
[options] | |
# | |
# WARNING: | |
# If you use the Odoo Database utility to change the master password be aware | |
# that the formatting of this file WILL be LOST! A copy of this file named | |
# /etc/odoo/openerp-server.conf.template has been made in case this happens | |
# Note that the copy does not have any first boot changes | |
#----------------------------------------------------------------------------- | |
# Odoo Server Config File - TurnKey Linux |
This file contains hidden or 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 | |
# apt-get install sshpass | |
# http://docs.saltstack.com/en/latest/topics/tutorials/preseed_key.html | |
BOOTSTRAP=/srv/minion-bootstrap.sh | |
LOG_LOCATION=/tmp/minion-bootstrap.log | |
TMP=/tmp/salt | |
if [[ -z "$1" ]] || [[ -z "$2" ]] ; then |
This file contains hidden or 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
update pg_database set datallowconn = TRUE where datname = 'template0'; | |
\c template0 | |
update pg_database set datistemplate = FALSE where datname = 'template1'; | |
drop database template1; | |
create database template1 with template = template0 encoding = 'UTF8'; | |
update pg_database set datistemplate = TRUE where datname = 'template1'; | |
template1 | |
update pg_database set datallowconn = FALSE where datname = 'template0'; | |
This file contains hidden or 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
@api.model | |
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True): | |
if not '_context_' in groupby: | |
return super(Task, self).read_group(domain, fields, groupby, | |
offset, limit, orderby, lazy) | |
else: | |
# Get the list of contexts | |
res = [] | |
for c in self.env['nibbana.context'].search( | |
[('create_uid','=', self.env.user.id)]): |
This file contains hidden or 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
@api.multi | |
def _get_kanban_color(self): | |
for self in self: | |
if not self.area_color: | |
continue | |
css = self.area_color[1:] | |
r,g,b = int(css[:2], 16), int(css[2:4], 16), int(css[4:], 16) | |
RGBint = (r<<16) + (g<<8) + b | |
self.kanban_color = RGBint | |
This file contains hidden or 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 xlrd | |
import sys | |
res = {} | |
rb = xlrd.open_workbook(sys.argv[1]) | |
sheet = rb.sheet_by_index(0) | |
for rownum in range(sheet.nrows): | |
row = sheet.row(rownum) |
This file contains hidden or 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 asyncio | |
import logging | |
from mqttrpc import MQTTRPCServer, dispatcher | |
logging.basicConfig(level=logging.INFO) | |
class TestMQTTRPCServer(MQTTRPCServer): | |
@dispatcher.public | |
def test(a): | |
return a |
NewerOlder