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
Feature: create filter example | |
Scenario: create a global sale.order filter | |
Given I need a "ir.filters" with oid: scen.delivered_sale_orders | |
And having: | |
| name | value | | |
| name | Delivered | | |
| domain | [('shipped_check', '=', True)] | | |
| model_id | sale.order | | |
| context | {} | | |
| user_id | False | |
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
#/bin/bash | |
set -x | |
for repo in */ | |
do | |
pushd $repo | |
reponame=$(basename $repo) | |
echo $reponame | |
git fetch origin | |
for version in 6.1 7.0 8.0 | |
do |
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
2947854-7-0-5b1147-base=# select name, author from ir_module_module where state='installed'; | |
name | author | |
-----------------------------+------------------------------------------------------------------------ | |
web_calendar | | |
web | | |
web_m2x_options | Tuxservices,Odoo Community Association (OCA) | |
auth_signup | OpenERP SA | |
web_list_html_widget | initOS GmbH & Co. KG,Odoo Community Association (OCA) | |
web_recipients_uncheck | initOS GmbH & Co. KG,Odoo Community Association (OCA) | |
web_search_alphabetic | Serpent Consulting Services Pvt. Ltd.,Odoo Community Association (OCA) |
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
class A(Model): | |
def _compute_B_count(self): | |
query = 'select a.id, count(b.id) from a right outer join b on (a.id=b.a_id) where a.id = ANY(%s)' | |
self.env.cr.execute(query, self.ids) | |
counts = dict(self.env.cr.fetchall()) | |
for rec in self: | |
rec.count = counts[rec.id] |
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
SELECT | |
t.tablename, | |
indexname, | |
c.reltuples AS num_rows, | |
pg_size_pretty(pg_relation_size(quote_ident(t.tablename)::text)) AS table_size, | |
pg_size_pretty(pg_relation_size(quote_ident(indexrelname)::text)) AS index_size, | |
CASE WHEN indisunique THEN 'Y' | |
ELSE 'N' | |
END AS UNIQUE, | |
idx_scan AS number_of_scans, |
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
import numpy.table | |
from unittest.mock import MagickMock | |
numpy.table.even = MagickMock(return_value=True) |
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
import requests | |
import random | |
server = 'http://localhost:8069' | |
session = requests.Session() | |
session.headers.update({'Content-Type': 'application/json'}) | |
data = {"jsonrpc": "2.0", | |
"id": random.randint(0, 1000000000), | |
"method": "call", |
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
diff --git a/addons/auth_crypt/models/res_users.py b/addons/auth_crypt/models/res_users.py | |
index 708998a..2c7d9b8 100644 | |
--- a/addons/auth_crypt/models/res_users.py | |
+++ b/addons/auth_crypt/models/res_users.py | |
@@ -28,11 +28,11 @@ class ResUsers(models.Model): | |
def init(self): | |
_logger.info("Hashing passwords, may be slow for databases with many users...") | |
- self.env.cr.execute("SELECT id, password FROM res_users" | |
- " WHERE password IS 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
session.open() | |
cr, uid = session.cr, 1 | |
Move = session.registry('stock.move') | |
Loc = session.registry('stock.location') | |
PackOp = session.registry('stock.pack.operation') | |
Pick = session.registry('stock.picking') | |
m1_ids = Move.search(cr, uid, [('picking_id.picking_type_id', '=', 11), ('state', '=', 'done'), ('move_dest_id.state', '=', 'assigned')]) | |
m1 = Move.browse(cr, uid, m1_ids) | |
m2_ids = [m.move_dest_id.id for m in m1] |
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
-- in restored dump | |
COPY ( | |
SELECT t.id, e.identification_id | |
FROM transport_order t JOIN hr_employee e ON (t.driver_id = e.id) | |
) TO '/tmp/transport.dat' | |
WITH (FORMAT binary); | |
-- in production database | |
CREATE TABLE tmp_transport (id INTEGER, driver VARCHAR); | |
COPY tmp_transport FROM '/tmp/transport.dat' WITH (FORMAT binary); |
OlderNewer