Use widget_tweaks everywhere

This commit is contained in:
Ludovic Stephan 2017-03-31 11:24:38 -03:00
parent ebf133d9af
commit fdcd2e864c
3 changed files with 12 additions and 16 deletions

View file

@ -485,9 +485,7 @@ class OrderArticleForm(forms.Form):
queryset=Article.objects.all(),
widget=forms.HiddenInput(),
)
quantity_ordered = forms.IntegerField(
required=False,
widget=forms.NumberInput(attrs={'class': 'form-control'}))
quantity_ordered = forms.IntegerField(required=False)
def __init__(self, *args, **kwargs):
super(OrderArticleForm, self).__init__(*args, **kwargs)
@ -514,18 +512,14 @@ class OrderArticleToInventoryForm(forms.Form):
)
price_HT = forms.DecimalField(
max_digits = 7, decimal_places = 4,
required = False,
widget=forms.NumberInput(attrs={'class': 'form-control'}))
required = False)
TVA = forms.DecimalField(
max_digits = 7, decimal_places = 2,
required = False,
widget=forms.NumberInput(attrs={'class': 'form-control'}))
required = False)
rights = forms.DecimalField(
max_digits = 7, decimal_places = 4,
required = False,
widget=forms.NumberInput(attrs={'class': 'form-control'}))
quantity_received = forms.IntegerField(
widget=forms.NumberInput(attrs={'class': 'form-control'}))
required = False)
quantity_received = forms.IntegerField()
def __init__(self, *args, **kwargs):
super(OrderArticleToInventoryForm, self).__init__(*args, **kwargs)

View file

@ -1,4 +1,5 @@
{% extends 'kfet/base.html' %}
{% load widget_tweaks %}
{% block title %}Nouvelle commande{% endblock %}
{% block content-header-title %}Nouvelle commande {{ supplier.name }}{% endblock %}
@ -60,7 +61,7 @@
<td>{{ form.v_prev }}</td>
<td>{{ form.stock }}</td>
<td>{{ form.c_rec }}</td>
<td>{{ form.quantity_ordered }}</td>
<td>{{ form.quantity_ordered | add_class:"form-control" }}</td>
</tr>
{% endfor %}
</tbody>

View file

@ -1,4 +1,5 @@
{% extends 'kfet/base.html' %}
{% load widget_tweaks %}
{% block title %}{% endblock %}
{% block content-header-title %}{% endblock %}
@ -33,11 +34,11 @@
<tr>
{{ form.article }}
<td>{{ form.name }}</td>
<td>{{ form.price_HT }}</td>
<td>{{ form.TVA }}</td>
<td>{{ form.rights }}</td>
<td>{{ form.price_HT | add_class:"form-control" }}</td>
<td>{{ form.TVA | add_class:"form-control" }}</td>
<td>{{ form.rights | add_class:"form-control" }}</td>
<td>{{ form.quantity_ordered }}</td>
<td>{{ form.quantity_received }}</td>
<td>{{ form.quantity_received | add_class:"form-control" }}</td>
{% endfor %}
</tbody>
</table>