add support for last_negative field

This commit is contained in:
Pierre-antoine Comby 2020-02-25 14:18:39 +01:00
parent 44b27e3ab3
commit 5a963eb281
1 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,8 @@ from django.db import transaction
import collections import collections
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.utils.timezone import make_aware
from django.db import IntegrityError from django.db import IntegrityError
from django.contrib.auth.models import User from django.contrib.auth.models import User
from note.models import Note, NoteSpecial, NoteUser, NoteClub from note.models import Note, NoteSpecial, NoteUser, NoteClub
@ -101,6 +103,9 @@ def import_comptes(cur,map_idbde):
} }
profile = Profile.objects.create(**obj_dict) profile = Profile.objects.create(**obj_dict)
note = user.note note = user.note
date = row.get("last_negatif",None)
if date != None:
note.last_negative = make_aware(date)
note.balance = row["solde"] note.balance = row["solde"]
obj_list =[user, profile, note] obj_list =[user, profile, note]
else: # club else: # club