Skip to content

Instantly share code, notes, and snippets.

View odony's full-sized avatar

Olivier Dony (ODO) odony

View GitHub Profile
@odony
odony / .fonts.conf
Last active May 10, 2021 07:54 — forked from silv3rm00n/.fonts.conf
Updated version of the fonts.conf file mentioned in http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux/ in order to get rid of most of the fontconfig warnings (mostly the "Having multiple values in <test> isn't supported and may not work as expected")
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@odony
odony / 8c3d71ccb88950ecc5741c76e7217e478e2f2988_partial.patch
Created February 12, 2015 11:47
partial patch for context propagation on tree_but_open actions in 8.0
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js
index 2f92042..380f160 100644
--- a/addons/web/static/src/js/view_tree.js
+++ b/addons/web/static/src/js/view_tree.js
@@ -222,27 +222,25 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
var local_context = {
active_model: self.dataset.model,
active_id: id,
- active_ids: [id]};
+ active_ids: [id]
@odony
odony / odoo_min_avg.sh
Created February 13, 2015 17:13
Sample Munin plugin for min/avg Odoo 8.0 RPC calls
#!/bin/sh
#%# family=manual
#%# capabilities=autoconf suggest
case $1 in
config)
echo graph_category openerp
echo graph_title openerp rpc requests min/average response time
echo graph_vlabel seconds
echo graph_args --units-exponent -3
echo min.label min
# Requires a local Odoo 9 server that is only listening to 127.0.0.1
# interface on port 8069, with website/ecommerce installed, and
# a proper --db-filter setting. --proxy-mode recommended too.
# This is an *untested* sample nginx configuration for demo purpose,
# please double-check all the settings and test the actual security
# of your setup - don't take it for granted.
# It is likely to break some built-in features of Odoo as well,
# might require whitelisting some extra routes.
# Setup an appropriate nginx log_format in the `http` section of your nginx config:
log_format main '$remote_addr $time_iso8601 "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_host" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time ';
# Then save the following as a munin plugin to monitor the last 5 minutes of your nginx access.log file
# Enable request logging in Odoo using one of the following:
# * pass --log-level=debug_rpc
# * or pass --log-handler=odoo.http.rpc.request:DEBUG (to only debug request times)
# * or set the equivalent config option in the Odoo config file
# Then save the following as a munin plugin to monitor the last 5 minutes of your Odoo config file
# Be sure to set the correct path for the Odoo log file, and adjust the variables as needed
#!/bin/bash
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index f630eef..7794ff8 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@odony
odony / groups_implied_perf.saas-16.patch
Created May 31, 2017 16:05
Perf patch for group management on databases with many users
diff --git odoo/addons/base/res/res_users.py odoo/addons/base/res/res_users.py
index ae8863e..c3e3a41 100644
--- odoo/addons/base/res/res_users.py
+++ odoo/addons/base/res/res_users.py
@@ -624,8 +624,29 @@ class GroupsImplied(models.Model):
if values.get('users') or values.get('implied_ids'):
# add all implied groups (to all users of each group)
for group in self:
- vals = {'users': zip(repeat(4), group.with_context(active_test=False).users.ids)}
- super(GroupsImplied, group.trans_implied_ids).write(vals)
@odony
odony / keybase.md
Created July 25, 2017 12:33
keybase.md

Keybase proof

I hereby claim:

  • I am odony on github.
  • I am odony (https://keybase.io/odony) on keybase.
  • I have a public key ASDs1AzG7_qAU0OmXyvweogzxe12go53tqZTcxxgrQ7HOAo

To claim this, I am signing this object:

@odony
odony / Analysis.sql
Last active December 9, 2018 21:22
10.0 stock.quant GROUP BY timings for translations
10e=# SELECT (SELECT COUNT(*) FROM product_product), (SELECT COUNT(*) FROM stock_quant), (SELECT COUNT(*) FROM ir_translation);
count | count | count
-------+-------+--------
41072 | 42082 | 409600
(1 row)
10e=# show work_mem;
work_mem
----------
64MB