From 74a2e265fa4dfb487ea62923527d1431abaf6d15 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Sat, 25 Aug 2018 11:10:18 +0200 Subject: [PATCH] Donne la bonne date lors de l'import des factures dans BaseInvoice. --- cotisations/migrations/0032_custom_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cotisations/migrations/0032_custom_invoice.py b/cotisations/migrations/0032_custom_invoice.py index e143ae13..68963bf5 100644 --- a/cotisations/migrations/0032_custom_invoice.py +++ b/cotisations/migrations/0032_custom_invoice.py @@ -14,7 +14,9 @@ def reattribute_ids(apps, schema_editor): BaseInvoice = apps.get_model('cotisations', 'BaseInvoice') for f in Facture.objects.all(): - base = BaseInvoice.objects.create(id=f.pk, date=f.date) + base = BaseInvoice.objects.create(id=f.pk) + base.date = f.date + base.save() f.baseinvoice_ptr = base f.save()