This file contains hidden or 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
# Copyright 2020 ForgeFlow, S.L. (https://www.forgeflow.com) | |
# Copyright 2020 Camptocamp | |
import logging | |
from odoo import _, models | |
from odoo.exceptions import UserError | |
from odoo.tools import float_compare | |
_logger = logging.getLogger(__name__) |
This file contains hidden or 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
log('Start fixing stock level') | |
query = """ | |
WITH product AS | |
( | |
select distinct product_id from stock_move where state='done' and create_date > '2020-11-14 00:00:00' | |
), | |
location AS (SELECT id AS location_id, usage FROM stock_location), | |
error_move_lines AS (SELECT * FROM ( | |
SELECT sml.id, | |
ROW_NUMBER() OVER (PARTITION BY move_id) as row, |
This file contains hidden or 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
""" | |
set model to Inventory, add contextual action | |
""" | |
record.line_ids._compute_theoretical_qty() |
This file contains hidden or 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
""" | |
scheduled action 1 | |
""" | |
log('Cron: started fix stock level') | |
query = """ | |
WITH product AS | |
( | |
select distinct product_id from stock_move where state='done' and create_date > '2020-11-14 00:00:00' | |
), |
This file contains hidden or 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 unittest import TestCase | |
def some_method(msg): | |
raise ValueError(msg) | |
class MyTest(TestCase): | |
def test_assert_raises_regex(self): |
This file contains hidden or 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
======== Testing test_server.py ======== | |
('command: ', '/entrypoint_image') | |
* Starting PostgreSQL 9.6 database server [80G | |
[74G[ OK ] | |
Waiting to start psql service.....psql service started. | |
Working in /home/odoo/build/OCA/server-tools | |
Using repo odoo/odoo and addons path /home/odoo/build/OCA/server-tools,/home/odoo/odoo-10.0/addons | |
Modules to test: ['attachment_base_synchronize', 'auditlog', 'auth_admin_passkey', 'auth_ip_access', 'auth_oauth_multi_token', 'auth_signup_verify_email', 'auth_supplier', 'auth_totp', 'auth_totp_password_security', 'auth_user_case_insensitive', 'auto_backup', 'base_cron_exclusion', 'base_custom_info', 'base_directory_file_download', 'base_exception', 'base_export_manager', 'base_export_security', 'base_external_dbsource', 'base_external_dbsource_firebird', 'base_external_dbsource_mssql', 'base_external_dbsource_mysql', 'base_external_dbsource_odbc', 'base_external_dbsource_oracle', 'base_external_dbsource_sqlite', 'base_external_system', 'base_fontawesome', 'base_import_ |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# Copyright 2017 Camptocamp SA | |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | |
import datetime | |
import random | |
from freezegun import freeze_time | |
import time | |
def create_products(ctx, nb_products=15000): | |
vals = [] |
This file contains hidden or 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/sh | |
ROOT=$(dirname $0)/.. | |
CONF=${ROOT}/odoo.conf | |
ODOODIR=${ROOT}/src | |
ODOOBIN="${ODOODIR}/odoo-bin --config=${CONF}" | |
ADDONS_PATH=${ROOT}/local-src,${ROOT}/external-src/enterprise,${ODOODIR}/odoo/addons,${ODOODIR}/addons | |
for d in ${ROOT}/external-src/* | |
do | |
if [ $d != enterprise ] |
This file contains hidden or 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
#include <iconv.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <locale.h> | |
int main(){ | |
iconv_t cd; | |
cd = iconv_open("ascii//TRANSLIT", "utf-8"); |
This file contains hidden or 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); |
NewerOlder