Skip to content

Instantly share code, notes, and snippets.

version: '3.3'
services:
# Web Application Service Definition
# --------
#
# All of the information needed to start up an odoo web
# application container.
web:
platform: linux/amd64
@foxcarlos
foxcarlos / ceg.txt
Last active June 15, 2021 13:42
CEG
# Leer sugerencia de Hiaura
https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_select_related
#Eliminar las migraciones desde Posgresql
# - Entrar a psql
docker exec -it billing-backend_db_1 psql -U billing
# Listar las migraciones
SELECT * FROM django_migration;
# Eliminar o por nombre de la app o directamente por cada ID
delete FROM django_migrations where app='document';
@foxcarlos
foxcarlos / kite.txt
Last active December 1, 2020 16:24
kite vim
[installer] with systemd, run systemctl --user start kite-autostart
[installer] without systemd, run /home/foxcarlos/.local/share/kite/kited
[installer] or launch it using the Applications Menu
@foxcarlos
foxcarlos / borrar.py
Created November 11, 2020 15:59
fix bug
def _import_data(self):
persons = self.search([])
for record in persons:
record.l10n_latam_identification_type_id.name = 'VAT'
rp_copy = record
rp_id = record.partner_id.id if record.partner_id else ''
rp = self.env['res.partner'].search([('id', '=', rp_id)])
rp_copy.copy()
record.unlink()
@foxcarlos
foxcarlos / odoo_luengo.py
Last active August 27, 2020 20:58
Ejemplo para luengo
class MyEmployee(model.Models):
_inherit = 'hr.employee
_name = 'MiModel'
primer_nombre = fields.Char()
segundo_nombre = fields.Char()
'''
Esto lo que hace es que crea una tabla nueva llamada MiModel en la base de datos
con todos los campos que tiene hr.employee y adicional le agrega los campos
@foxcarlos
foxcarlos / git_clone.py
Last active September 7, 2020 11:40
git_clone.py
# Configuracion para git pull
git config pull.rebase false # hacer merge (estrategia por defecto)
git config pull.rebase true # aplicar rebase
git config pull.ff only # aplicar solo fast-forward
Command line instructions
You can also upload existing files from your computer using the instructions below.
@foxcarlos
foxcarlos / NOTAS
Last active October 1, 2020 12:16
Notas Varias
# QWEB ODOO
https://www.realsystems.com.mx/en_US/blog/desarrollo-openerp-odoo-9/post/condicionantes-en-vistas-qweb-357
https://www.cybrosys.com/blog/advanced-qweb-operations-in-odoo
https://github.com/odoo/odoo/blob/9.0/addons/website_sale/views/templates.xml#L1072-L1080
https://www.odoo.com/es_ES/forum/ayuda-1/question/how-to-send-json-object-in-the-body-of-a-post-request-in-controller-141116
NOTAS:USO DE VIM
http://www.sromero.org/wiki/linux/aplicaciones/manual_vim
@foxcarlos
foxcarlos / [Vauxoo]odoo_runbot_ssh.txt
Last active January 15, 2020 12:33
Acceder al Runbot vias ssh
Cuando algo no puedas reproducir localmente, puedes acceder al runbot por ssh como lo vimos en nuestra llamada así:
- https://youtu.be/_Yb9BjOCfMU
O puedes correr un travis2docker con tu nueva PR, con los siguientes parámetros:
t2d git@git.vauxoo.com:cotesma/cotesma.git pull/16
./10-build.sh "--no-cache --pull"
./20-run.sh "--entrypoint=bash"
Ya estando dentro del container, lo tendrás reproducido corriendo:
/entrypoint.sh
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini | paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini | paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini | paloma')
@foxcarlos
foxcarlos / fulltextodoo.py
Created December 9, 2019 19:10
SQL Full Text Search PostgreSQL
sql = "select * from directory_telephone where to_tsvector(name) @@ to_tsquery('farmacia | norte');"
self._cr.execute(sql)
self._cr.fetchall()
# select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('farmacia | norte');
# select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('farmacia & norte');
# select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('farmacia | norte');