Skip to content

Instantly share code, notes, and snippets.

View nhomar's full-sized avatar
🏠
Life is beautiful

Nhomar [Vauxoo] nhomar

🏠
Life is beautiful
View GitHub Profile
import urllib
testfile = urllib.URLopener()
testfile.retrieve("http://www.sat.gob.mx/informacion_fiscal/tablas_indicadores/Documents/tc_2015.xls", "tc_2015.xls")
@nhomar
nhomar / record.yml
Created March 29, 2015 06:36
Yml Templates
-
Setting Full width on theme_avantgarde. Due to the geniuses odoos guys I am
trying to disable one and enable the oposite instead use the model method.
-
!python {model: ir.ui.view}: |
self.write(cr, uid, [ref('theme_avantgarde.avantgarde_option_layout_fullwidth')], {'active': True}, context={'active_test': True})
self.write(cr, uid, [ref('theme_avantgarde.avantgarde_option_layout_boxed')], {'active': False}, context={'active_test': True})
@nhomar
nhomar / .travis.yml
Created March 29, 2015 07:53
.travis template
language: python
python:
- "2.7"
env:
- VERSION="8.0" ODOO_REPO="vauxoo/odoo" INCLUDE="lodi"
- VERSION="8.0" ODOO_REPO="vauxoo/odoo" UNIT_TEST="1"
virtualenv:
@nhomar
nhomar / assets.xml
Created March 29, 2015 20:37
assets_less
<!-- Customization modal -->
<template id="avantgarde_custom_modal_less" inherit_id="website.assets_frontend" active="True">
<xpath expr="//link[last()]" position="after">
<link href="/theme_avantgarde/static/src/less/customize_modal.less" rel="stylesheet" type="text/less"/>
</xpath>
</template>
@nhomar
nhomar / author.py
Last active September 10, 2015 22:22
Autoría
# -*- encoding: utf-8 -*-
##############################################################
# Module Writen For Odoo, Open Source Management Solution
#
# Copyright (c) 2011 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info Vauxoo ([email protected])
# coded by: [email protected]
# [email protected]
# planned by: [email protected]
File "/usr/local/lib/python2.7/site-packages/stoqdrivers/printers/fiscal.py", line 181, in totalize
result = self._driver.coupon_totalize(discount, surcharge, taxcode)
File "/usr/local/lib/python2.7/site-packages/stoqdrivers/printers/bematech/MP25.py", line 635, in coupon_totalize
type, int(value * Decimal('1e2'))))
File "/usr/local/lib/python2.7/site-packages/stoqdrivers/printers/bematech/MP4000.py", line 227, in _send_command
self._check_error(retval)
File "/usr/local/lib/python2.7/site-packages/stoqdrivers/printers/bematech/MP25.py", line 365, in _check_error
status.check_error()
File "/usr/local/lib/python2.7/site-packages/stoqdrivers/printers/bematech/MP4000.py", line 544, in check_error
self._check_error_in_dict(self.st2_codes, self.st2)
@nhomar
nhomar / screenshot
Created October 5, 2015 06:12 — forked from dotStart/screenshot
Provides a simple Amazon S3 screenshot tool.
#!/bin/bash
#----------
# Akkarin's Simple S3 Screenshot Script
#
# Requirements:
# - shutter
# - awscli
# - zenity
#
# Note: The directory defined in $SCREENSHOT_PATH needs to exist!
@nhomar
nhomar / logic_frontend
Last active December 8, 2015 02:09
logic
<template id="product_box" name="product">
<hi><t t-esc="title"/></h1>
<div>
<t t-set="counter" t-value=1/>
<t t-foreach="products" t-as="p">
<t t-call="product_detail_vertical"/>
</t>
</div>
</template>
@nhomar
nhomar / attributes.py
Created February 11, 2016 19:24
Get all attributes of an object.
print dir(invoice.ups)
for e in dir(invoice.ups):
if not e.startswith('__'):
print '---- attr: ', e
print type(invoice.ups.__getattribute__(e))
print invoice.ups.__getattribute__(e)
@nhomar
nhomar / click_example.py
Created February 13, 2016 01:39
Base gist cuando quiera hacer un script.
# coding: utf-8
import click
'''Command line interface for cfdilib
'''
class Config(object):
def __init__(self):
self.verbose = False