forked from DGNum/gestioCOF
Auth et affichage caisses
This commit is contained in:
parent
90e8ece783
commit
b628808493
5 changed files with 16 additions and 6 deletions
|
@ -4,6 +4,7 @@ from django.contrib.auth.models import User, Group, Permission
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||
from django.forms import modelformset_factory
|
||||
from django.utils import timezone
|
||||
from kfet.models import (Account, Checkout, Article, OperationGroup, Operation,
|
||||
CheckoutStatement, ArticleCategory)
|
||||
from gestioncof.models import CofProfile
|
||||
|
@ -161,7 +162,9 @@ class ArticleRestrictForm(ArticleForm):
|
|||
|
||||
class KPsulOperationGroupForm(forms.ModelForm):
|
||||
checkout = forms.ModelChoiceField(
|
||||
queryset = Checkout.objects.filter(is_protected=False),
|
||||
queryset = Checkout.objects.filter(
|
||||
is_protected=False, valid_from__lte=timezone.now(),
|
||||
valid_to__gte=timezone.now()),
|
||||
widget = forms.HiddenInput())
|
||||
class Meta:
|
||||
model = OperationGroup
|
||||
|
@ -184,7 +187,9 @@ class KPsulAccountForm(forms.ModelForm):
|
|||
|
||||
class KPsulCheckoutForm(forms.Form):
|
||||
checkout = forms.ModelChoiceField(
|
||||
queryset=Checkout.objects.filter(is_protected=False),
|
||||
queryset=Checkout.objects.filter(
|
||||
is_protected=False, valid_from__lte=timezone.now(),
|
||||
valid_to__gte=timezone.now()),
|
||||
widget=forms.Select(attrs={'id':'id_checkout_select'}))
|
||||
|
||||
class KPsulOperationForm(forms.ModelForm):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue