Exemplo n.º 1
0
class VentaSearchForm(forms.Form):
    cliente = forms.ModelChoiceField(queryset=Cliente.objects.all(),
                                     widget=autocomplete.ModelSelect2(
                                         url='cliente-autocomplete', ),
                                     required=False)
    user = forms.ModelChoiceField(queryset=User.objects.all(),
                                  widget=autocomplete.ModelSelect2(
                                      url='user-autocomplete', ),
                                  required=False)
    #cliente = forms.ModelChoiceField(widget=autocomplete.ModelSelect2(url='cliente-autocomplete',), required=False)
    desde = forms.DateField(
        widget=AdminDateWidget(attrs={'placeholder': 'Desde'}), required=False)
    hasta = forms.DateField(
        widget=AdminDateWidget(attrs={'placeholder': 'Hasta'}),
        required=False,
        initial=datetime.now())
Exemplo n.º 2
0
 class Meta:
     model = Venta
     fields = [
         'cliente',
     ]
     widgets = {
         "cliente": autocomplete.ModelSelect2(url='cliente-autocomplete'),
     }
Exemplo n.º 3
0
 class Meta:
     model = Compra
     fields = [
         'proveedor',
     ]
     widgets = {
         "proveedor":
         autocomplete.ModelSelect2(url='proveedor-autocomplete'),
     }
Exemplo n.º 4
0
 class Meta:
     model = DetalleVenta
     fields = ['producto', 'preciounitario', 'cantidad', 'subtotal']
     widgets = {
         "producto": autocomplete.ModelSelect2(url='producto-autocomplete'),
     }