Skip to content

Instantly share code, notes, and snippets.

@florentx
florentx / openerp-stdout.log
Created July 11, 2013 08:28
OpenERP 6.1 with Werkzeug 0.9.1
2013-07-11 08:06:29,372 20378 ERROR ? openerp.addons.web.common.http.HttpRequest.dispatch: An error occurred while handling a json request
Traceback (most recent call last):
File "/srv/openerp/instances/openerp/src/web/addons/web/common/http.py", line 260, in dispatch
r = method(controller, self, **self.params)
File "/srv/openerp/instances/openerp/src/web/addons/web/controllers/main.py", line 1876, in index
cookies={'fileToken': int(token)})
File "/srv/openerp/instances/openerp/src/web/addons/web/common/http.py", line 307, in make_response
response.set_cookie(k, v)
File "/srv/openerp/.buildout/eggs/Werkzeug-0.9.1-py2.6.egg/werkzeug/wrappers.py", line 960, in set_cookie
self.charset))
2081-03-15T23:25:02,2078-03-10T19:31:34
1987-08-20T19:14:03,2029-11-13T01:33:25
2025-03-22T18:42:50,2095-03-28T13:49:00
1934-09-22T20:04:50,1926-05-14T06:41:35
2038-08-18T13:31:05,1948-05-20T22:42:15
1942-05-14T19:02:46,2021-12-29T11:44:41
1909-05-20T03:47:53,2083-10-10T21:48:34
2048-10-20T11:53:20,1984-02-08T09:38:25
2028-05-12T06:39:36,2029-12-25T09:36:52
1907-03-17T09:24:56,1970-03-16T12:36:24
@florentx
florentx / disable_tiny_spyware_openerp61.xml
Last active December 19, 2015 07:19
This is for OpenERP 6.1 -- Of course the spyware is mutating in each version ... moved to the "mail" addon in 7.0 it seems.
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Disable the spyware - OpenERP 6.1 :-) -->
<record id="base.ir_cron_ping_scheduler" model="ir.cron">
<field eval="False" name="active"/>
</record>
</data>
@florentx
florentx / myaddon_test.py
Created June 24, 2013 11:44
Integration between Python unit-tests and OpenERP <assert/>
# -*- coding: utf-8 -*-
import unittest
from openerp.myaddon.util import osv_unittest
class MyTests(unittest.TestCase):
def test_upper(self):
self.assertEqual('dn_vn_nsn'.upper(), 'DN_VN_NSN')
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,
# -*- coding: utf-8 -*-
import pep8
class MyReport(pep8.BaseReport):
def __init__(self, options):
super(MyReport, self).__init__(options)
self.all_errors = []
@florentx
florentx / gist:5292155
Created April 2, 2013 13:22
Split a Bazaar repository (example of Pyflakes)
# * install latest Bazaar
# * install bzr-fastimport
# * `pip install fastimport`
bzr branch lp:divmod.org divmod.org
bzr fast-export --no-plain divmod.org divmod.fi.gz
bzr fast-import-filter -i Pyflakes/ divmod.fi.gz > pyflakes.fi
bzr init pyflakes-fi
cd pyflakes-fi
bzr fast-import ../pyflakes.fi

Bootstrap OpenERP 6.1 or 7.0

This repository contains a zc.buildout bundle to install and configure OpenERP and some related tools on Debian or Ubuntu. This is tested on Debian Squeeze.

Features:

  • install and configure OpenERP 6.1 or 7.0 (using anybox.recipe.openerp)
  • install and configure supervisor
@florentx
florentx / flake8nodelay
Last active December 15, 2015 08:39
Output Flake8 errors immediately
#!python
# https://github.com/jcrocholl/pep8/issues/181
import sys
import pep8
from flake8.engine import get_style_guide
from flake8.main import DEFAULT_CONFIG
class ImmediateReport(pep8.BaseReport):
@florentx
florentx / pep8xml.py
Last active June 6, 2018 05:43
XML output format for pep8
#!python
import pep8
from xml.etree import ElementTree as ET
def prettyindent(elem, level=0):
# Adapted from http://effbot.org/zone/element-lib.htm#prettyprint
ind = "\n" + level * " "
if level:
elem.tail = ind