Skip to content

Instantly share code, notes, and snippets.

View ray-odoo's full-sized avatar
💭
Spreading purple around the world!

Ray Carnes ray-odoo

💭
Spreading purple around the world!
View GitHub Profile
delete from crm_lead;
delete from purchase_order_line;
delete from purchase_order;
delete from sale_order_line;
delete from sale_order;
delete from procurement_order;
delete from procurement_group;
Phone
Hotel
Internet
Meals - Client
Meals - Employee
Shipping
Supplies
Travel Insurance
Airfare
Baggage
TURN OFF:
update ir_mail_server set active = 'f';
update fetchmail_server set active = 'f';
update ir_cron set active = 'f' where function = 'schedule_backup';
TURN ON:
update ir_mail_server set active = 't';
update fetchmail_server set active = 't';
update ir_cron set active = 't' where function = 'schedule_backup';
@ray-odoo
ray-odoo / gist:b0b474d2246d662c9207ac2294f63833
Created December 7, 2018 18:54
KILL PostgreSQL connections preventing an Odoo database from being deleted (without restarting PostgreSQL)
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = 'database_name';
@ray-odoo
ray-odoo / gist:bd97d69b3e308d10f531c8392b71f7d6
Last active September 28, 2018 17:12
Large database backup and restore process
OUT:
pg_dump production --no-owner --format=c --file=production.sql
FILESTORE:
tar -czvf /home/ubuntu/production.tar.gz production
IN:
@ray-odoo
ray-odoo / gist:cef23d6fee6e2e819250fa19ac289c2d
Last active September 23, 2018 17:46
Upgrade SAAS to Enterprise (July 2015)
1. Take a backup of the SAAS database. (You must be logged into odoo.com as the Administrator of the database).
2. Perform the following PSQL:
update ir_module_module set state = 'to remove' where name = 'saas_trial';
insert into base_config_settings(auth_signup_reset_password) values(true);
update res_partner set signup_type='reset', signup_token='rsvabcdefghijykalklk', signup_expiration=to_timestamp('20200411','YYYYMMDD') where id=(select partner_id from res_users where id=1);
ALT: