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
@blaggacao
blaggacao / scrape_co_chart_of_accounts.py
Last active June 24, 2023 16:35
Scrape Colombian CoA for ERPNext
View scrape_co_chart_of_accounts.py
#!/usr/bin/env python
"""
This script scrapes the colombian chart of accounts in two variants from https://puc.com.co
https://puc.com.co is the most trusted online resource for CoA in Colombia.
Note on Account Types:
account types are mapped on the longest prefix in the 'account_types' dictionary below,
please modify as updates become necessary and rescrape the chart of accounts.
View frappe_schema_json_diff.py
import sys
import json
import re
from dataclasses import dataclass
from json_source_map import calculate
from rich.console import Console
from rich.tree import Tree
from rich.table import Table
@blaggacao
blaggacao / flake.nix
Last active October 3, 2021 16:37
merge-overlay
View flake.nix
{ description = "A mini merge DSL for data overlays";
inputs.nixlib.url = "github:nix-community/nixpkgs.lib";
outputs = { self, nixlib }: let
# Incrementailty of the Data Spine
# --------------------------------
# Te reduce mental complexity in merging chains,
# we must ensure that the data spine of the left
# hand side is not destructively modified.
#
@blaggacao
blaggacao / pyproject.toml
Created December 10, 2019 00:11
poetry-toml
View pyproject.toml
[tool.poetry]
name = "dodoo"
version = "0.1.0"
description = "A suck-less Odoo server middleware; batteries included."
authors = [
"David Arnold <dar@xoe.solutions>"
]
license = "LGPL-3.0+"
readme = 'README.md'
repository = "https://github.com/xoe-labs/dodoo"
@blaggacao
blaggacao / keybase.md
Created November 12, 2019 18:24
kaybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am blaggacao on github.
  • I am blaggacao (https://keybase.io/blaggacao) on keybase.
  • I have a public key ASA_AUKyzpVNocXuVKTUarYDUj6sLILhXlufjq-pPWceKgo

To claim this, I am signing this object:

@blaggacao
blaggacao / Studio2PythonFields
Last active May 13, 2021 23:53
Odoo Studio to Python XSLT
View Studio2PythonFields
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="http://www.foo.org/" xmlns:bar="http://www.bar.org">
<xsl:template name="printIndented">
<xsl:param name="text" />
<xsl:param name="indent" />
<xsl:if test="$text">
<xsl:value-of select="$indent" />
<xsl:variable name="thisLine" select="substring-before($text, '&#10;')" />
<xsl:choose>
@blaggacao
blaggacao / attribute-string-redundant.py
Last active July 27, 2019 16:59
pylint-odoo: attribute-string-redundant
View attribute-string-redundant.py
# Copyright 2019 David Arnold
# Licensed under the MIT License
import re
from bowler.helpers import print_tree, print_selector_pattern, find_last
from bowler.query import Query
from bowler.types import TOKEN, SYMBOL
from fissix.pytree import Leaf, Node
from fissix.fixer_util import Comma
FIELDS_METHOD = {
View _repocompletion.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from requests.exceptions import RequestException
from prompt_toolkit import prompt
from prompt_toolkit.completion import FuzzyWordCompleter
@blaggacao
blaggacao / rip-modules.sh
Created June 19, 2019 01:54
One Module On Repo (OMOR) for OCA
View rip-modules.sh
#!/bin/bash
SCRIPT=$(realpath -s $0)
SCRIPTPATH=$(dirname $SCRIPT)
urls=$(curl "https://api.github.com/users/$1/repos?page=$2&per_page=100" | grep -e 'git_url*' | cut -d \" -f 4)
gitub_api_token=SECRET
branch_list="8.0 9.0 10.0 11.0"
View migration.yaml
--- !Migration
version: 0.2.3
app_version: 10.0
--- !Migration
version: 3.0.0-rc.1
app_version: 12.0
service: odoo
pre_scripts:
- ../migration.d/orchestrate-10-to-12-refactoring-pre.py
uninstall: