Skip to content

Instantly share code, notes, and snippets.

View lepistone's full-sized avatar

Leonardo Pistone lepistone

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lepistone on github.
  • I am lepistone (https://keybase.io/lepistone) on keybase.
  • I have a public key whose fingerprint is DA7A 045B FC7E DC52 35C0 AFAA 0A54 7A40 1A4A FEED

To claim this, I am signing this object:

#!/bin/bash
set -e
USAGE="Discover Features and launch behave to run OERPScenarios\n
\n
oerpscenario [options]\n
\n
Options:\n
-t <TAG_EXPRESSION>: run Features / Scenarios tagged with TAG_EXPRESSION (see below)\n
--help-behave: display behave help (to know which behave options you can pass\n
# second version: we use GeneratorExit to stop
# no more need for a method, hence no need for a class
def accumulator(batch_size):
try:
while True:
batch = []
for c in range(batch_size):
received = yield
var result = (
this.fields_view.arch.attrs.force_editable_mode || (
!this.grouped &&
!this.options.disable_editable_mode
&& (this.fields_view.arch.attrs.editable
|| this._context_editable
|| this.options.editable))
);
console.log(result);
console.log("\n");
@lepistone
lepistone / gist:3ca65107fc7344440777
Created March 3, 2015 10:10
How to create and pre-populate a not null column in odoo.
def _auto_init(self, cr, context):
"""Fill in the required consignee column with default values.
This is similar to the solution used in mail_alias.py in the core.
The installation of the module will succeed with no errors, and the
column will be required immediately (the previous solution made it
required only on the first module update after installation).
"""
@lepistone
lepistone / fix-people-name.sh
Last active August 29, 2015 14:07
fix-people-name.sh
#!/bin/bash
# This is rough script I used to fix authors and committers with the correct
# email but the name "unknown" from the account-analytic project.
#
# That situation happened because with bzr we committed merges with
# --author email@example.com, without specifying the author name. This caused
# those commits to show up as "unknown" when migrated to git.
#
# Improved by @yvaucher.
@lepistone
lepistone / odoo8_sale_confirm_pseudocode.py
Last active October 30, 2015 12:58
Odoo 8: what happens when you confirm a Sale Order (pseudocode)
# This is pseudocode.
#
# I copied and simplified some of the code that gets run when you validate a
# Sale Order in Odoo 8.
#
# More or less, a procurement is created, copying the Route from the order line
# if it has been specified.
#
# Then the procurement is immediately run, and a choice is made on the rule to
# use.