create checkout dynamically

This commit is contained in:
Ludovic Stephan 2017-02-08 15:26:56 -02:00
parent 1062fd480f
commit 4e62eb0aee
3 changed files with 12 additions and 3 deletions

View file

@ -1 +0,0 @@
[{"fields": {"name": "Chaudron", "created_by": 101, "is_protected": false, "valid_from": "2017-02-06T23:00:00Z", "valid_to": "2018-08-30T22:00:00Z", "balance": "0.00"}, "model": "kfet.checkout", "pk": 1}]

View file

@ -81,13 +81,23 @@ class Command(MyBaseCommand):
liq_account = Account.objects.get_or_create(cofprofile=liq_profile, liq_account = Account.objects.get_or_create(cofprofile=liq_profile,
trigramme='LIQ') trigramme='LIQ')
# ---
# Caisse
# ---
checkout = Checkout.objects.get_or_create(
created_by=Account.objects.get(username='Moralelastix'),
name='Chaudron',
valid_from=timezone.now(),
valid_to=timezone.now() + timedelta(years=1)
)
# --- # ---
# Opérations # Opérations
# --- # ---
articles = Article.objects.all() articles = Article.objects.all()
accounts = Account.objects.exclude(trigramme='LIQ') accounts = Account.objects.exclude(trigramme='LIQ')
checkout = Checkout.objects.all()[0]
num_op = 100 num_op = 100
# Operations are put uniformly over the span of a week # Operations are put uniformly over the span of a week

View file

@ -3,6 +3,6 @@
source ~/venv/bin/activate source ~/venv/bin/activate
python manage.py migrate python manage.py migrate
python manage.py loaddata gestion sites articles checkout python manage.py loaddata gestion sites articles
python manage.py loaddevdata python manage.py loaddevdata
python manage.py collectstatic --noinput python manage.py collectstatic --noinput