Skip to content

Instantly share code, notes, and snippets.

View cmorisse's full-sized avatar

cmorisse cmorisse

View GitHub Profile
@cmorisse
cmorisse / gist:6fd5d3ede6bd587c48ca26eb7d84ae7d
Created August 13, 2019 10:39
to allow vscode debugger to run on odoo
diff --git a/odoo/fields.py b/odoo/fields.py
index e4b153f3982..76caf1f38c5 100644
--- a/odoo/fields.py
+++ b/odoo/fields.py
@@ -333,6 +333,7 @@ class Field(MetaField('DummyField', (object,), {})):
def __getattr__(self, name):
""" Access non-slot field attribute. """
+ print(name)
try:
@cmorisse
cmorisse / ir.actions.server.py
Created August 9, 2019 04:58 — forked from andrius-preimantas/ir.actions.server.py
Odoo server action to recompute stored fields
# Recompute amount_total for account.invoice
env.add_todo(model._fields['amount_total'], object)
model.recompute()
# where
# object - recordset of instances to recompute field for
# model - recordset instances model
@cmorisse
cmorisse / monkey_patch__reexec.py
Last active November 13, 2018 05:22
Odoo 12 _rexec() monkey patch for anybox.recipe.buildout compatibilty
import os
import sys
import logging
from odoo.service import server
from odoo.tools import misc
"""
Import this file from one loaded Odoo addon.
Update line 20 with path to odoo launcher.
@cmorisse
cmorisse / netproxy.js
Last active February 28, 2018 06:58
netproxy docker and remote debugging fix
/*
* Copyright (C) 2015, Ajax.org B.V.
* This software is available under the Cloud9 SDK License, available from
* https://github.com/c9/core/blob/master/LICENSE.
*/
var net = require("net");
var debuggedProcessHost = "{DEBUGGED_PROCESS_HOST}";
var debuggedProcessPort = parseInt("{DEBUGGED_PROCESS_PORT}", 10);
@cmorisse
cmorisse / ufw.md
Last active October 31, 2016 09:19 — forked from kimus/ufw.md
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@cmorisse
cmorisse / install_odoo_in_cloud9_blank_workspace.md
Last active April 15, 2018 09:37
Install odoo in a cloud9 "Blank" workspace
 _____          _        _ _   _____     _               _                          
|_   _|        | |      | | | |  _  |   | |             (_)                         
  | | _ __  ___| |_ __ _| | | | | | | __| | ___   ___    _ _ __                     
  | || '_ \/ __| __/ _` | | | | | | |/ _` |/ _ \ / _ \  | | '_ \                    
 _| || | | \__ \ || (_| | | | \ \_/ / (_| | (_) | (_) | | | | | |                   
 \___/_| |_|___/\__\__,_|_|_|  \___/ \__,_|\___/ \___/  |_|_| |_|                   
                                                                                    
                                                                                    
 _ _______ _             _    _ _   _    _            _