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

View file

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

View file

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