8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 19:33:11 +00:00

Fix : various little things

This commit is contained in:
Maël Kervella 2018-04-15 13:34:51 +00:00
parent 6c30c36943
commit f7f8f7493b
3 changed files with 7 additions and 5 deletions

View file

@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post"> <form class="form" method="post">
{% csrf_token %} {% csrf_token %}
{% if articlesformset %}
<h3>{% trans "Invoice's articles" %}</h3> <h3>{% trans "Invoice's articles" %}</h3>
<div id="form_set" class="form-group"> <div id="form_set" class="form-group">
{{ articlesformset.management_form }} {{ articlesformset.management_form }}
@ -54,11 +55,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Total price : <span id="total_price">0,00</span> Total price : <span id="total_price">0,00</span>
{% endblocktrans %} {% endblocktrans %}
</p> </p>
{% endif %}
{% bootstrap_form factureform %} {% bootstrap_form factureform %}
{% bootstrap_button action_name button_type='submit' icon='star' %} {% bootstrap_button action_name button_type='submit' icon='star' %}
</form> </form>
{% if articlesformset %}
<script type="text/javascript"> <script type="text/javascript">
var prices = {}; var prices = {};
{% for article in articles %} {% for article in articles %}
@ -133,6 +135,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
update_price(); update_price();
}); });
</script> </script>
{% endif %}
{% endblock %} {% endblock %}

View file

@ -489,7 +489,7 @@ def add_paiement(request):
# TODO : chnage paiement to Payment # TODO : chnage paiement to Payment
@login_required @login_required
@can_edit(Paiement) @can_edit(Paiement)
def edit_paiement(request, paiement_instance, *_kwargs): def edit_paiement(request, paiement_instance, **_kwargs):
""" """
View used to edit a payment method. View used to edit a payment method.
""" """

View file

@ -171,13 +171,13 @@ def can_delete_set(model):
all_objects = model.objects.all() all_objects = model.objects.all()
instances_id = [] instances_id = []
for instance in all_objects: for instance in all_objects:
can, msg = instance.can_delete(request.user) can, _msg = instance.can_delete(request.user)
if can: if can:
instances_id.append(instance.id) instances_id.append(instance.id)
instances = model.objects.filter(id__in=instances_id) instances = model.objects.filter(id__in=instances_id)
if not instances: if not instances:
messages.error( messages.error(
request, msg or "Vous ne pouvez pas accéder à ce menu") request, "Vous ne pouvez pas accéder à ce menu")
return redirect(reverse( return redirect(reverse(
'users:profil', 'users:profil',
kwargs={'userid': str(request.user.id)} kwargs={'userid': str(request.user.id)}