Skip to content

Instantly share code, notes, and snippets.

View blaggacao's full-sized avatar
🚩
Working on an (ad)venture

David Arnold blaggacao

🚩
Working on an (ad)venture
View GitHub Profile
1867 | 2018-08-01 00:17:45.648994 | 2018-08-08 23:42:07.260899 | 1 | | 598 | 89724 | 99 | tree | <data> +| 1 | | t | | Odoo Studio: account.move.line.tree customization | extension | account.move.line | | f | | | | f | |
| | | | | | | | | <xpath expr="//tree[not(ancestor::field)]" position="attributes"> +| | | | | | | | | | | | | | |
|
@blaggacao
blaggacao / migration.py
Last active May 5, 2019 21:03
Some odoo.migration backed migration
from odoo import migration
CITY_XMLID_MAP = {} # TODO: Rename external Ids (Yan's work)
REGIME_OBLIGATION_XMLID_MAP = {
"1": "obligation_type_0",
"2": "obligation_type_1",
"3": "obligation_type_2",
"4": "obligation_type_3",
"5": "obligation_type_4",
@blaggacao
blaggacao / libvirt.tf
Created April 6, 2019 22:13
RancherOS libvirt testing cluster
# Uses https://github.com/dmacvicar/terraform-provider-libvirt/releases/tag/v0.5.1
# Merged https://github.com/dmacvicar/terraform-provider-libvirt/pull/476
# Merged https://github.com/dmacvicar/terraform-provider-libvirt/pull/567
# Download rancher iso
# Transform rancher iso with
# `qemu-img convert -f raw -O qcow2 .../rancheros.iso .../rancheros.qcow2`
# For loacal domain specific DNS to work:
# sudo cp /etc/resolv.conf{,.bk}
# sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
@blaggacao
blaggacao / models.js
Created December 20, 2018 16:46
PR26363
_export_for_printing: function(){
var orderlines = [];
this.orderlines.each(function(orderline){
orderlines.push(orderline.export_for_printing());
});
var paymentlines = [];
this.paymentlines.each(function(paymentline){
paymentlines.push(paymentline.export_for_printing());
});
@blaggacao
blaggacao / invoice.py
Created December 17, 2018 14:56
generateDS UBL2.0 DIAN bindings
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Sun Dec 16 19:02:41 2018 by generateDS.py version 2.30.8.
# Python 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
#
# Command line options:
# ('-o', 'invoice.py')
# ('-s', 'invoicesubs.py')
@blaggacao
blaggacao / stylsheet.xsl
Created November 30, 2018 00:33
Odoo XML to CSV the easy way
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:variable name="delimiter" select="','" />
<!-- deinfe an array containing the fields we are interested in -->
<xsl:variable name="fieldArray">
<field>name</field>
<field>code</field>
<field>financial_report_id</field>
$ pre-commit run --all-files
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/asottile/pyupgrade.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Trim Trailing Whitespace.................................................Failed
hookid: trailing-whitespace
Traceback (most recent call last):
@blaggacao
blaggacao / loader.py
Created October 9, 2018 15:06
Parallel loading
"""Load data efficiently into Odoo"""
import threading
import xmlrpclib
import hashlib
import sys
import json
import datetime
import pandas as pd, numpy as np
from time import time, sleep
@blaggacao
blaggacao / Readme.md
Last active September 28, 2018 13:00
Odoo-Operator Dev Onboarding
@blaggacao
blaggacao / odoocluster.yml
Created September 25, 2018 23:04
Example Odoo Cluster
apiVersion: "odoo.k8s.io/v1alpha1"
kind: "OdooCluster"
metadata:
name: "mausi"
namespace: "odoo"
spec:
tracks:
- name: "v10"
image:
registry: "docker.io"