From 3f2de5739c225a10713b4de6659683de8c07af05 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Mon, 2 Jul 2018 14:24:53 +0200 Subject: [PATCH] =?UTF-8?q?Retire=20les=20=C3=A9l=C3=A9ments=20de=20front?= =?UTF-8?q?=20en=20JS=20pour=20les=20ch=C3=A8ques.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cotisations/forms.py | 11 +---------- .../templates/cotisations/new_facture.html | 18 ------------------ 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/cotisations/forms.py b/cotisations/forms.py index a9f47f28..a5db7b92 100644 --- a/cotisations/forms.py +++ b/cotisations/forms.py @@ -61,21 +61,12 @@ class NewFactureForm(FormRevMixin, ModelForm): # for something more generic or at least in English if allowed_payment: self.fields['paiement'].queryset = allowed_payment - self.fields['cheque'].required = False - self.fields['banque'].required = False - self.fields['cheque'].label = _("Cheque number") - self.fields['banque'].empty_label = _("Not specified") self.fields['paiement'].empty_label = \ _("Select a payment method") - paiement_list = Paiement.objects.filter(type_paiement=1) - if paiement_list: - self.fields['paiement'].widget\ - .attrs['data-cheque'] = paiement_list.first().id - class Meta: model = Facture - fields = ['paiement', 'banque', 'cheque'] + fields = ['paiement'] def clean(self): cleaned_data = super(NewFactureForm, self).clean() diff --git a/cotisations/templates/cotisations/new_facture.html b/cotisations/templates/cotisations/new_facture.html index 6e90a12f..ddb1ece8 100644 --- a/cotisations/templates/cotisations/new_facture.html +++ b/cotisations/templates/cotisations/new_facture.html @@ -44,7 +44,6 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} {% bootstrap_form factureform %} {{ venteform.management_form }} -

{% trans "Invoice's articles" %}

{% for form in venteform.forms %} @@ -132,20 +131,6 @@ with this program; if not, write to the Free Software Foundation, Inc., ) } - function set_cheque_info_visibility() { - var paiement = document.getElementById("id_Facture-paiement"); - var visible = paiement.value == paiement.getAttribute('data-cheque'); - p = document.getElementById("id_Facture-paiement"); - var display = 'none'; - if (visible) { - display = 'block'; - } - document.getElementById("id_Facture-cheque") - .parentNode.style.display = display; - document.getElementById("id_Facture-banque") - .parentNode.style.display = display; - } - // Add events manager when DOM is fully loaded document.addEventListener("DOMContentLoaded", function() { document.getElementById("add_one") @@ -155,9 +140,6 @@ with this program; if not, write to the Free Software Foundation, Inc., for (i = 0; i < product_count; ++i){ add_listenner_for_id(i); } - document.getElementById("id_Facture-paiement") - .addEventListener("change", set_cheque_info_visibility, true); - set_cheque_info_visibility(); update_price(); });