From 6c74c73157749e3705fcc66185b9bc08c2bc8a96 Mon Sep 17 00:00:00 2001 From: Phuoc CAO Date: Sun, 14 Mar 2021 17:44:40 +0100 Subject: [PATCH] =?UTF-8?q?batch=5Ftest=20pr=C3=AAt=20pour=20la=20prod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mondumas/views/utils.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mondumas/views/utils.py b/mondumas/views/utils.py index bae2af1..cb050f1 100644 --- a/mondumas/views/utils.py +++ b/mondumas/views/utils.py @@ -197,8 +197,20 @@ def batch_test(request): until_date = date(TODAY.year - 10, TODAY.month, 1) purge_mensuelle(request, until_date) purge_clients(request) - delete_orphan_attached_files(request) - + + # delete_orphan_attached_files(request) + + update_chantiers_delais(request, date(TODAY.year - 1, TODAY.month, 1)) + + societes = ['PL', 'ME', 'PE'] + datejour = TODAY + groupes = ['MAIF', 'AXA', 'X'] + for i in range(12): + for societe in societes: + for groupe in groupes: + update_stats_delais(request, societe, datejour.strftime('%Y-%m-%d'), groupe) + # recule d'un mois + datejour = datejour + relativedelta(months=-1) return Response('Batch nuit terminé OK')