I hereby claim:
- I am guewen on github.
- I am guewen (https://keybase.io/guewen) on keybase.
- I have a public key ASAQTfK_7H26dnaTrYfE2YF_iXZotEEMvW97PWhFgilG2Ao
To claim this, I am signing this object:
| #!/usr/bin/env python3 | |
| from itertools import permutations | |
| class GrecianComputer: | |
| def __init__(self, layers): | |
| self.layers = layers | |
| self.layer_positions = [0, 0, 0, 0, 0] |
| from odoo.addons.stock_analytic.models.stock_move import StockMove | |
| from odoo.addons.analytic.models.analytic_mixin import AnalyticMixin | |
| orig_need = StockMove._need_validate_distribution | |
| def patched_need(self): | |
| result = orig_need(self) | |
| print("NEED_VALIDATE move=%s result=%s state=%s ctx=%s" % ( | |
| self.id, result, self.state, self.env.context.get("validate_analytic"))) | |
| return result |
| # to run in odoo shell | |
| import timeit | |
| code_recordset = """ | |
| result = env['product.product'].browse() | |
| for record in records: | |
| result |= record | |
| """ |
| from odoo.tools import convert_file | |
| convert_file(env.cr, 'account_invoice_sent', 'wizards/account_invoice_state_view.xml', {}, mode='update', kind='data') | |
| env.cr.commit() | |
| def reload(addon, path): | |
| from odoo.tools import convert_file | |
| convert_file(env.cr, addon, path, {}, mode='update', kind='data') | |
| env.cr.commit() |
| CREATE OR REPLACE FUNCTION normalize_query(IN TEXT, OUT TEXT) AS $body$ | |
| SELECT | |
| regexp_replace( | |
| lower($1), | |
| -- Remove IN values | |
| 'in\s*\([,\s\?]*\)', 'in (...)', 'g' ) | |
| ; | |
| $body$ | |
| LANGUAGE SQL; |
| # -*- coding: utf-8 -*- | |
| # Copyright 2016 Camptocamp SA | |
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | |
| import logging | |
| import random | |
| import threading | |
| from collections import defaultdict |
I hereby claim:
To claim this, I am signing this object:
| # Dockerfile | |
| FROM ubuntu:14.04 | |
| # Set the locale | |
| RUN locale-gen en_US.UTF-8 | |
| ENV LANG en_US.UTF-8 | |
| ENV LANGUAGE en_US:en | |
| ENV LC_ALL en_US.UTF-8 | |
| # Install dependencies |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Dowload new log files from S3. | |
| New files are compressed with gzip and only new files are downloaded. | |
| """ | |
| from __future__ import print_function |
| -- Needs pg_buffercache | |
| select count(*) from pg_buffercache; |