Skip to content

Instantly share code, notes, and snippets.

View alt-odoo's full-sized avatar
👻
"We will all be archived one day, one way or another." Odoobot

Alex Tuyls alt-odoo

👻
"We will all be archived one day, one way or another." Odoobot
View GitHub Profile
@alt-odoo
alt-odoo / query.sql
Created April 23, 2021 07:58
Find big tables in Postgres
SELECT schemaname||'.'||tablename as table,
pg_size_pretty (pg_total_relation_size(schemaname||'.'||tablename)) as size
from pg_tables
order by pg_total_relation_size(schemaname||'.'||tablename) desc;
@alt-odoo
alt-odoo / sequence_fix_1.py
Last active February 22, 2021 15:56
Fix 1 Sequence V14
journals = env['account.journal'].search([])
sequence_list = ''
for journal in journals:
jmove = env['account.move'].search([('journal_id','=',journal.id)],order = 'date desc', limit = 1)
sequence_list += '{} (#{} {})\n'.format(jmove.name, journal.id,journal.name)
raise Warning(sequence_list)
@alt-odoo
alt-odoo / sequence_fix_2.py
Last active March 12, 2021 11:41
Fix 2 Sequence V14
# Specify the date where the sequence was broken (e.g. most probably the migration to prod date)
date_sequence = '20XX-XX-XX'
# Specify ID of concerned journals, leave empty to fix for all journals
journal_ids = []
corrected_moves=[]
query = """
SELECT id,journal_id, date, name
FROM (
@alt-odoo
alt-odoo / pos_check_payments.py
Created May 26, 2020 21:56 — forked from jev-odoo/pos_check_payments.py
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')
@alt-odoo
alt-odoo / pos_compare_orders.py
Created May 26, 2020 21:56 — forked from jev-odoo/pos_compare_orders.py
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',
@alt-odoo
alt-odoo / gist:f2f8e0d80509482142a9711d1c2ab97c
Last active March 8, 2021 11:05
saas_worker url to duplicate db
TO DUPLICATE A DB DIRECTLY FROM SUPPORT PAGE
https://XXXXX.odoo.com/saas_worker/dup?to=YYYYY&support=True