Skip to main content

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')

image.png

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;
Procédure pour importer les utilisateurs odoo :
  • Importer les utilisateurs pros qui ont adhérés en 2022

  • Importer le reste des utilisateurs pros

  • Vérifier la présence des associations

    • (attention changer "Recyclerie la benne idée" en association

    • attention compagnie des anes accent sur le A ?

    • pas de michto ?

    • "NANCY CURIEUX", "CLAIMM", "AVEC NANCY", "ASSOCIATION GASPAR","HATHA YOGARMONIE","ROUGGE", "OLA (ORGANISATION LOCALE D’AUTOSUFFISANCE)", "ASSOCIATION CULTURELLE DU VAL DE LORRAINE","NANCY JAZZ PULSATIONS","MJC DES 3 MAISONS","MJC LILLEBONNE",

INSERT INTO res_partner (name, display_name, firstname, lastname, ref, phone, email, active, lang, customer, supplier, employee, is_company, is_published, to_renew, is_volunteer, currency_exchange_office, is_adhered_member, free_member) VALUES ('Guigui Roro', 'Guigui Roro', 'Guigui', 'Roro', '3999', '0606060606', 'truc@toto.fr', 't', 'fr_FR', 't', 'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f');

Ajouter des droits SQL

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';