Skip to content

Instantly share code, notes, and snippets.

@dmattosr
dmattosr / odoo.conf
Created January 8, 2017 13:15 — forked from ryanc-me/odoo.conf
Sample Odoo/Nginx Config (with dbfilter_from_header support)
# Author: Ryan Cole
# Website: https://ryanc.me
# GitHub: https://github.com/MGinshe
# Usage:
# Place this file in /etc/nginx/sites-enabled/
# Make sure you edit the DOMAIN_HERE and SSL_CERTIFICATE, and DB_FILTER sections
#
# Note: This config file is designed to be used with the Odoo dbfilter_from_header module
# https://apps.openerp.com/apps/modules/9.0/dbfilter_from_header/
import requests
def get_data_doc_number(user, password, tipo_doc, numero_doc, format='json'):
'''
# url = 'http://py-devs.com:8888/api'
url = 'http://py-devs.com/api'
tipo_doc = 'dni' o 'ruc'
'''
url = 'http://py-devs.com/api'
# url = 'http://localhost:8000/api'
def pos(fila, columna, filas, columnas, lista=None):
if not lista:
lista = range(filas*columnas)
if not filas * columnas <= len(lista):
print 'Error: verificar filas * columnas <= len(lista)'
if not fila < filas:
print 'Error: verificar fila < filas'
elif not columna < columnas:
print 'Error: verficar columna < columnas'
def check(matriz):
def getXY(row, col, matriz):
lCol =[matriz[x][col] for x in range(len(matriz)) if x!=row]
fila = matriz[row]
lFil = [fila[x] for x in range(len(fila)) if x!=col]
return lCol+lFil
l = range(len(matriz))
for row in l: