Skip to content

Instantly share code, notes, and snippets.

import datetime
import time
QUANT_NUMBER = 0
QUANT_ERRORS = 0
QUANT_RESET = 0
QUANT_ML_NUMBER = 0
QUANT_ML_ERRORS = 0
QUANT_ML_RESET = 0
ML_NUMBER = 0
@jev-odoo
jev-odoo / odoorpc.py
Last active July 1, 2020 13:05
OdooRPC
USER = 'admin'
PASS = 'admin'
import xmlrpc.client
HOST = <your_database_host> # ex: http://localhost:8069
DB = <your_database_name>
COMMON = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(HOST))
UID = COMMON.authenticate(DB, USER, PASS, {})
@jev-odoo
jev-odoo / pos_change_cash_basis_taxes.py
Last active April 3, 2020 12:03
POS - Change Cash Basis Taxes On pos_order_lines
# FOR VERSION 12
# Set sessions ids between the brackets, separated by a coma
# I.E. SESSION_ID = [12, 18, 132] or SESSION_ID = [4]
SESSION_IDS = [record.id]
# DO NOT MODIFY
VALID_VERSIONS = (12,)
VALID_SESSION_STATES = ('opened', 'closing_control')
LOG_LINE_ACTION_NAME = 'POS - Change Cash Basis Taxes'
LOG_LINE_NAME = 'Support Intervention'
@jev-odoo
jev-odoo / pos_balance.py
Last active December 9, 2020 11:04
POS - Balance
# FOR VERSION 13
# Set sessions ids between the brackets, separated by a coma
# I.E. SESSION_ID = [12, 18, 132] or SESSION_ID = [4]
# Set DEFAULT_ACCOUNT account_id as simple integer (not required)
SESSION_IDS = []
MODE = 'check'
DEFAULT_ACCOUNT = 0
# DO NOT MODIFY
VALID_VERSIONS = (13,)
@jev-odoo
jev-odoo / pos_compare_orders.py
Last active July 30, 2020 07:26
POS - Compare Orders
# FOR VERSION 12, 12.3, 13
# Set sessions ids between the brackets, separated by a coma
# I.E. SESSION_ID = [12, 18, 132] or SESSION_ID = [4]
SESSION_IDS = []
FIELDS_TO_DISPLAY_IN_CSV = [ # Comment the field you don't want to see
'name',
'price_unit',
'tax_is',
'tax_should_be',
'diff_tax',
@jev-odoo
jev-odoo / pos_check_payments.py
Last active November 6, 2020 11:45
POS - Check Payments
# FOR VERSION 10,11,12,13,...
# Set sessions ids between the brackets, separated by a coma
# I.E. SESSION_ID = [12, 18, 132] or SESSION_ID = [4]
SESSION_ID = []
MODE = 'check'
# DO NOT MODIFY
VALID_VERSIONS = (10, 11, 12, 13,)
VALID_SESSION_STATES = ('opened', 'closing_control')
VALID_MODES = ('check', 'repair')
@jev-odoo
jev-odoo / pos_split.py
Last active April 15, 2020 12:30
POS - Split
# FOR VERSION 12 and 12.3
# Set sessions ids between the brackets, separated by a coma
# I.E. SESSION_ID = [12, 18, 132] or SESSION_ID = [4]
SESSION_IDS = []
MODE = 'check'
SPLIT_KEYWORD = 'Split'
MAX_ORDER_PER_SESSION = 200
# DO NOT MODIFY
VALID_VERSIONS = (11, 12,)
@jev-odoo
jev-odoo / fix_reconcile_stock.py
Last active February 7, 2020 15:27
POS - Fix Reconcile Stock
SESSION_IDS = [<<SESSION_IDS>>]
db_version = 0
latest_version = env['ir.module.module'].search([('name', '=', 'base')]).latest_version.replace('~', '-')
for version in (10, 11, 12, 13):
if latest_version.startswith(str(version)) or latest_version.startswith('saas-%s' % str(version)):
db_version = version
@jev-odoo
jev-odoo / pos_rescue.py
Last active October 27, 2020 09:17
POS - Rescue
# FOR VERSION 10,11,12,13,...
# Set sessions ids between the brackets, separated by a coma
# I.E. SESSION_ID = [12, 18, 132] or SESSION_ID = [4]
SESSION_ID = []
# DO NOT MODIFY
VALID_VERSIONS = (10, 11, 12, 13, 14)
VALID_SESSION_STATES = ('opened', 'closing_control')
MESSAGES = []
@jev-odoo
jev-odoo / global_vars.py
Last active February 3, 2020 14:06
Scripts Global Vars
# --------------------------------------------------------------------------
# GLOBALS - Adjust as needed
CRON_BEGIN_UTC = datetime.time(<<BEGIN_UTC_HOUR>>, <<BEGIN_UTC_MIN>>) # UTC TIME
CRON_END_UTC = datetime.time(<<END_UTC_HOUR>>, <<END_UTC_MIN>>) # UTC TIME
USER_MUST_BE_IN_COMPANY = False # False or company_id
MAXIMUM_ORDER_BY_SESSION = <<MAX_ORDER_BY_SESSION>>
EMAIL_TO = '[email protected]'
RETRY_FAILED_PROCESS = False
SPLIT_SESSION_KEYWORD = 'Split'
SMALL_SESSIONS = False