This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'ox-latex) | |
(unless (boundp 'org-latex-classes) | |
(setq org-latex-classes nil)) | |
(add-to-list 'org-latex-classes | |
'("doc_vaud" | |
"\\documentclass[french,fleqn,10pt,hidelinks]{article} | |
\\usepackage[utf8]{inputenc} | |
\\usepackage{titling} | |
\\usepackage{babel} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Opening task when double clicking on project --> | |
<record id="dblc_proj" model="ir.actions.act_window"> | |
<field name="res_model">project.task</field> | |
<field name="name">Project's tasks</field> | |
<field name="view_type">form</field> | |
<field name="view_mode">tree,form,calendar,graph,gantt,kanban</field> | |
<field name="domain">[('project_id', 'child_of', [active_id])]</field> | |
<field name="context">{'project_id':active_id, 'active_test':False}</field> | |
</record> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns repl.xml_to_csv | |
(:use [hiccup.core] | |
[clojure-csv.core :as csv])) | |
(defn csv-data [] (csv/parse-csv (slurp "/Users/nbessi/Downloads/doc/zip.csv"))) | |
(defn render-line [line] | |
(html [:record {:id (line 0), :model "res.better.zip"} | |
[:field {:name "name"} (line 1)] | |
[:field {:name "city"} (line 2)] | |
[:field {:name "state_id", :ref (str "state_" (line 3))}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using https://github.com/rvalyi/ooor/pull/81 in background | |
Given I find or create by login a ResUsers "admin" with | |
| key | val | | |
| partner_id | find by xml_id blabla | | |
#or | |
| partner_id | find by name and login! Pinky, daBoss | | |
and why not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Removed some output related to extra-addons | |
STATEMENT: ALTER TABLE "res_partner_address" ALTER COLUMN "country_id" SET NOT NULL | |
ERROR: column "smtp_host" contains null values | |
STATEMENT: ALTER TABLE "ir_mail_server" ALTER COLUMN "smtp_host" SET NOT NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Thanks to Florent for the function. | |
#Really useful. | |
def osv_method(f): | |
"""Decorator with boilerplate for OSV methods.""" | |
args, varargs, kwargs, defaults = getargspec(f) | |
len_argspec = len(args) - 4 | |
# Sanity check: no *args or **kwargs parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MYCONST = ('new_val', 'New Label') | |
class Partner(osv.osv): | |
"""My Stuff""" | |
_inherit = 'res.partner' | |
def __init__(self, pool, cursor): | |
"""Hack due to the lack of selection fields inheritance mechanism.""" | |
super(Partner, self).__init__(pool, cursor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print self.geo_search(cursor, uid, domain=[('name', 'ilike', 'Lausanne')], geo_domain=[('the_geom', 'geo_greater', Polygon([(3, 0), (4, 1), (4, 0)]))]) | |
print self.geo_search(cursor, uid, domain=[('name', 'ilike', 'Lausanne')], geo_domain=[('the_geom', 'geo_greater', 0)]) | |
print self.geo_search(cursor, uid, domain=[('name', 'ilike', 'Lausanne')], geo_domain=[('the_geom', 'geo_intersect', {'geoengine.demo.automatic.retailing.machine.the_point': []})]) | |
print self.geo_search(cursor, uid, domain=[('name', 'ilike', 'Lausanne')], geo_domain=[('the_geom', 'geo_intersect', {'geoengine.demo.automatic.retailing.machine.the_point': [('name','!=','Vallorbe')]})]) | |
#will generate | |
""" | |
SELECT "res_better_zip".id FROM "res_better_zip" WHERE (res_better_zip."name" ilike E'%Lausanne%') AND ST_Area(res_better_zip.the_geom) > ST_Area(ST_GeomFromText('POLYGON ((3.0000000000000000 0.0000000000000000, 4.0000000000000000 1.0000000000000000, 4.0000000000000000 0.0000000000000000, 3.0000000000000000 0.0000000000000000))')) ORDER BY pr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from shapely.wkt import dumps as wktdumps, loads as wktloads | |
from shapely.geometry import Polygon, MultiPolygon | |
import geojson | |
from base_geoengine import geo_model | |
class NPA(geo_model.GeoModel): | |
_inherit = "res.better.zip" | |
_columns = { | |
'the_geom' : fields.geo_multi_polygon('NPA Shape', required=False), |
NewerOlder