Divers
Export Adh Odoo
select t1.name,t1.membership_start,t1.membership_stop,t1.ref,t1.membership_state,t2.name from res_partner AS t1 INNER JOIN res_partner AS t2 ON t2.id=t1.orga_choice
copy (select t1.name,t1.membership_start,t1.membership_stop,t1.ref,t1.membership_state,t2.name from res_partner AS t1 INNER JOIN res_partner AS t2 ON t2.id=t1.orga_choice) To '/tmp/test.csv' With CSV DELIMITER ',' HEADER;
Configuration Odoo
Mettre à jour le module lcc_members
systemctl stop odoo12
su - odoo12
python3 -m venv odoo-venv
source odoo-venv/bin/activate
cd /opt/odoo12/odoo
./odoo-bin -u lcc_members -c /etc/odoo12.conf
Suppression du 2ème menu Membres
Aller dans Configuration puis Activer le mode développeur
Aller ensuite dans Configuration puis dans le menu Technique puis dans le sous-menu interface utilisateur aller dans Eléments de menu
Ajouter un Filtre Membres et Archiver le dernier Membres.
Actions automatisés
Installer le module "Règles d'action automatisées" ou "Automated Action Rules"
partners = model.search([])
for partner in partners:
if ((partner.ref != False) and (partner != record)):
if partner.ref == record.ref:
raise Warning('Num adh deja existant')
Purger les factures et les paiements
select id,ref,partner_id from account_move_line;
delete from account_move_line where partner_id=829;
delete from account_move where partner_id=829;
select * from account_payment;
select * from account_invoice;
select id,credit,debit,partner_id from account_move_line;
select credit_move_id,debit_move_id from account_partial_reconcile;
delete from account_partial_reconcile where id=2;
delete from account_move_line where partner_id=829;
delete from account_move where partner_id=829;
delete from account_invoice where id=2;
ALL PURGE:
delete from account_invoice;
delete from account_partial_reconcile;
delete from account_move_line;
delete from account_move;
delete from res_partner where id>15;
delete from res_partner where email!='tech@florain.fr' and email!='odoobot@example.com'
Changer le prix de la facture
update account_invoice set amount_untaxed=12 where partner_id=2810;
update account_invoice set amount_untaxed_signed=12 where partner_id=2810;
update account_invoice set amount_total=12 where partner_id=2810;
update account_invoice set amount_total_signed=12 where partner_id=2810;
update account_invoice set amount_total_company_signed=12 where partner_id=2810;
---
update account_invoice set residual=12 where partner_id=2810;
update account_invoice set residual_signed=12 where partner_id=2810;
update account_invoice set residual_company_signed=12 where partner_id=2810;
Ajouter des droits SQL (odoo v12)
GRANT SELECT ON res_partner TO florain;
grant insert, select, update on res_partner to florain;
grant insert,select,update on membership_membership_line to florain;
grant insert,select,update on account_invoice to florain;
grant insert,select,update on account_invoice_line to florain;
grant select,usage on account_invoice_id_seq to florain;
grant select,usage on account_invoice_line_id_seq to florain;
grant select,usage on res_partner_id_seq to florain;
SELECT grantee, privilege_type
FROM information_schema.role_table_grants
WHERE table_name='membership_membership_line';
Ajouter des droits SQL (odoo v16)
grant insert,select,update on res_partner to florain;
grant insert,select,update on account_move to florain;
grant insert,select,update on account_move_line to florain;
grant insert,select,update on account_move_line_account_tax_rel to florain;
grant insert,select,update on membership_membership_line to florain;
grant select,usage on account_move_id_seq to florain;
grant select,usage on account_move_line_id_seq to florain;
grant select,usage on membership_membership_line_id_seq to florain;
Ajouter des droits SQL
ALTER USER user_name WITH PASSWORD 'xxxx';
Upgrade la database Odoo
./odoo-bin --addons-path=/opt/odoo12/odoo/addons,/opt/odoo12/odoo-custom-addons --database=odoo --upgrade-path=/opt/OpenUpgrade/scripts/ --update
./odoo-bin -d migration --update all --stop-after-init --data-dir=/tmp --database=odoo
https://www.syncoria.com/blog/blog-6/how-can-you-upgrade-odoo-11-to-14-the-best-way-to-do-it-62
Bug après restauration d'un LXC Odoo
Feb 06 15:01:43 cyclos postgresql@13-main[570]: Examine the log output.
Feb 06 15:01:43 cyclos postgresql@13-main[570]: pg_ctl: could not start server
Feb 06 15:01:43 cyclos postgresql@13-main[570]: 2024-02-06 14:01:43.262 UTC [575] LOG: database system is shut down
Feb 06 15:01:43 cyclos postgresql@13-main[570]: 2024-02-06 14:01:43.262 UTC [575] FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
Feb 06 15:01:43 cyclos postgresql@13-main[570]: Error: /usr/lib/postgresql/13/bin/pg_ctl /usr/lib/postgresql/13/bin/pg_ctl start -D /var/lib/postgresql/13/main -l /var/log/postgresql/postgresql-13-main.log -s -o -c config_file="/etc/postgresql/13/main/postgresql.conf" exited with status 1:
gpasswd -a postgres ssl-cert
chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
chmod 740 /etc/ssl/private/ssl-cert-snakeoil.key
/etc/init.d/postgresql start
