Skip to content

Instantly share code, notes, and snippets.

View rvalyi's full-sized avatar

Raphaël Valyi rvalyi

View GitHub Profile
cd tests
find . -type f -print0 | xargs -0 sed -i '/Python 2.7.14/c\# Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]'
find . -type f -print0 | xargs -0 sed -i 's/ascii/utf-8/g'
python test.py # (can be python2 or python3)
/* after running OpenUpgrade to upgrade to a newer Odoo version, when you start Odoo,
you typically have warning logs about modules not found.
You may uninstall them with a command such as
update ir_module_module set state='uninstalled' where name IN (...);
and then clean the databases of the problematic records of these modules with the following scripts:
*/
/* disable view and menus of uninstalled modules: */
delete from ir_ui_view where id in (select ir_model_data.res_id from ir_model_data join ir_module_module on ir_module_module.name = ir_model_data.module where model='ir.ui.view' and state='uninstalled');
delete from ir_ui_menu where id in (select ir_model_data.res_id from ir_model_data join ir_module_module on ir_module_module.name = ir_model_data.module where model='ir.ui.menu' and state='uninstalled');
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server
ODOO+DOCKY INSTALATION ON UBUNTU 18.04 LTS BIONIC
# SSH as root
apt-get update
# Add erp user:
adduser erp
sudo visudo
# add this line ( see https://phpraxis.wordpress.com/2016/09/27/enable-sudo-without-password-in-ubuntudebian/ )
erp ALL=(ALL) NOPASSWD:ALL
@rvalyi
rvalyi / mixin.py
Last active August 29, 2018 18:01
# -*- coding: utf-8 -*-
from odoo import fields, models, api
#from . import leiauteNFe as nfe
from spec_models import StackedModel
#from odoo.addons.l10n_br_nfe.models.v3_10 import leiauteNFe
# overriden to deal with conditional visibility and
# forcing to stack some optional taxes for usability consistency
# -*- coding: utf-8 -*-
from odoo import fields, models, api
#from . import leiauteNFe as nfe
from spec_models import StackedModel
#from odoo.addons.l10n_br_nfe.models.v3_10 import leiauteNFe
# overriden to deal with conditional visibility and
# forcing to stack some optional taxes for usability consistency
apply the following patch to Odoo:
diff --git a/odoo/cli/command.py b/odoo/cli/command.py
index cf9a410..7de4208 100644
--- a/odoo/cli/command.py
+++ b/odoo/cli/command.py
@@ -42,7 +42,11 @@ def main():
args = args[1:]
# Default legacy command
# -*- coding: utf-8 -*-
from odoo import models, fields
from . import sped
from . import leiauteNFelib as nfe
"""Exibilidade do ISS:1-Exigível;2-Não incidente;3-Isenção;4-Exportação;5-Imunidade;6-Exig.Susp. Judicial;7-Exig.Susp. ADM"""
indISS = [('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7')]
"""Origem do processo, informar com:
<editix:emitType xmlns:editix="http://www.portalfiscal.inf.br/nfe">
<editix:CPF>12345678901</editix:CPF>
<editix:xNome>Raphael</editix:xNome>
<editix:enderEmit xmlns:editix="http://www.portalfiscal.inf.br/nfe">
<editix:xLgr>NKwaAJ5ZJ49aQYmqBvxMhBzkGUqvtXnqusGEtjDzKCXPGwrEZCS8LGKHyBbV</editix:xLgr>
<editix:nro>11mzXHR8rZTgfE35EqfGhiShiIwQfLCAziFDXVgs3EjLSPkZkCvfGNLMEf5y</editix:nro>
<editix:xCpl>Fr3gSvoAeKbGpQD3r98KFeB50P3Gq14XBVsv5fpiaBvJ3HTOpREiwYGs20Xw</editix:xCpl>
<editix:xBairro>67LQFlXOBK0JqAE1rFi2CEyUGW5Z8QmmHhzmZ9GABVLKa9AbV0uFR0onl7nU</editix:xBairro>
<editix:cMun>9999999</editix:cMun>
<editix:xMun>s1Cr2hWP6bptQ80A9vWBuTaODR1U82LtKQi1DEm3LsAXu9AbkSeCtfXJVTKG</editix:xMun>
@rvalyi
rvalyi / gist:cf45840ce9288b27a5b3390657c3a227
Created August 1, 2017 16:24
diff kmee/odoo-brazil-banking branch fix/refactory_module_payment_mode
diff --git a/l10n_br_account_payment_boleto/boleto/document.py b/l10n_br_account_payment_boleto/boleto/document.py
index c851239..cf674e9 100644
--- a/l10n_br_account_payment_boleto/boleto/document.py
+++ b/l10n_br_account_payment_boleto/boleto/document.py
@@ -92,7 +92,7 @@ class Boleto:
self.boleto.especie = \
move_line.currency_id and move_line.currency_id.symbol or 'R$'
self.boleto.quantidade = '' # str("%.2f" % move_line.amount_currency)
- self.boleto.numero_documento = move_line.name.encode('utf-8')
+ self.boleto.numero_documento = move_line.id #move_line.name.encode('utf-8')