diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index fc1fd9e..df31f34 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,3 +2,5 @@ 25ef1599be197445f48680306846bbfb19590502 # misc: apply double-quote-string-fixer (#79788) f1941a3ad8fd726321ce19b2e0ce22a2a5911a6c +# apply new pre-commit hooks (#85632) +42ad175c4b191655a907ccae03c817f631a4dcbb diff --git a/debian/barbacompta.install b/debian/barbacompta.install index 60c9d3b..2d3a2e6 100644 --- a/debian/barbacompta.install +++ b/debian/barbacompta.install @@ -1,4 +1,4 @@ debian/barbacompta-manage /usr/bin +debian/barbacompta.service /lib/systemd/system debian/config.py /etc/barbacompta debian/uwsgi.ini /etc/barbacompta -debian/barbacompta.service /lib/systemd/system diff --git a/debian/control b/debian/control index d4dac47..5fc2982 100644 --- a/debian/control +++ b/debian/control @@ -2,28 +2,37 @@ Source: barbacompta Section: python Priority: optional Maintainer: Benjamin Dauvergne -Build-Depends: python3-setuptools, python3-all, python3-django, debhelper-compat (= 12), dh-python, sassc +Build-Depends: debhelper-compat (= 12), + dh-python, + python3-all, + python3-django, + python3-setuptools, + sassc, Standards-Version: 3.9.6 Homepage: https://dev.entrouvert.org/projects/barbacompta Package: python3-barbacompta Architecture: all -Depends: ${misc:Depends}, ${python3:Depends}, - python3-django (>= 2:3.2), - python3-cairosvg, - python3-facturx, - python3-xstatic-select2, - python3-gadjo, - python3-django-mellon, - weasyprint, - python3-caldav, +Depends: python3-cairosvg, + python3-caldav, + python3-django (>= 2:3.2), + python3-django-mellon, + python3-facturx, + python3-gadjo, + python3-xstatic-select2, + weasyprint, + ${misc:Depends}, + ${python3:Depends}, Description: Logiciel de compta/facturation interne Package: barbacompta Architecture: all -Depends: ${misc:Depends}, - python3-barbacompta (= ${binary:Version}), - python3-psycopg2 +Depends: python3-barbacompta (= ${binary:Version}), + python3-psycopg2, + ${misc:Depends}, Description: Logiciel de compta/facturation interne -Recommends: nginx, uwsgi, uwsgi-plugin-python3, python3-uwsgidecorators -Suggests: postgresql +Recommends: nginx, + python3-uwsgidecorators, + uwsgi, + uwsgi-plugin-python3, +Suggests: postgresql, diff --git a/eo_gestion/actions.py b/eo_gestion/actions.py index 04b0660..1f3bdba 100644 --- a/eo_gestion/actions.py +++ b/eo_gestion/actions.py @@ -22,7 +22,7 @@ import zipfile from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.template import Context, Template -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ def export_as_csv(modeladmin, request, queryset): diff --git a/eo_gestion/chorus/migrations/0001_initial.py b/eo_gestion/chorus/migrations/0001_initial.py index a6faac2..42c98d8 100644 --- a/eo_gestion/chorus/migrations/0001_initial.py +++ b/eo_gestion/chorus/migrations/0001_initial.py @@ -6,7 +6,6 @@ import eo_gestion.chorus.validators class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/eo_gestion/chorus/validators.py b/eo_gestion/chorus/validators.py index 5a37e0f..d4850ae 100644 --- a/eo_gestion/chorus/validators.py +++ b/eo_gestion/chorus/validators.py @@ -15,7 +15,7 @@ # along with this program. If not, see . from django.core.exceptions import ValidationError -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ def validate_luhn(string_value, length=None): diff --git a/eo_gestion/eo_banque/admin.py b/eo_gestion/eo_banque/admin.py index 4046c12..5316488 100644 --- a/eo_gestion/eo_banque/admin.py +++ b/eo_gestion/eo_banque/admin.py @@ -70,16 +70,14 @@ class LigneBanquePopAdmin(admin.ModelAdmin): actions = [actions.export_as_csv] list_filter = (MontantAffecteFilter,) + @admin.display(description='Montant') def column_montant(self, obj): return amountformat(obj.montant) - column_montant.short_description = 'Montant' - + @admin.display(description='Montant non affecté') def column_montant_non_affecte(self, obj): return amountformat(obj.montant_non_affecte()) - column_montant_non_affecte.short_description = 'Montant non affecté' - def lookup_allowed(self, *args, **kwargs): return True diff --git a/eo_gestion/eo_banque/management/commands/load-csv-banquepop.py b/eo_gestion/eo_banque/management/commands/load-csv-banquepop.py index 0672b1b..1f1c70a 100644 --- a/eo_gestion/eo_banque/management/commands/load-csv-banquepop.py +++ b/eo_gestion/eo_banque/management/commands/load-csv-banquepop.py @@ -15,7 +15,7 @@ class Command(BaseCommand): can_import_django_settings = True output_transaction = True - requires_system_checks = True + requires_system_checks = '__all__' args = ' ...' help = 'Charge les fichiers CSVs' HEADER = [ diff --git a/eo_gestion/eo_banque/management/commands/nouveau-solde.py b/eo_gestion/eo_banque/management/commands/nouveau-solde.py index fcf82f8..f2d5915 100644 --- a/eo_gestion/eo_banque/management/commands/nouveau-solde.py +++ b/eo_gestion/eo_banque/management/commands/nouveau-solde.py @@ -13,7 +13,7 @@ class Command(BaseCommand): can_import_django_settings = True output_transaction = True - requires_system_checks = True + requires_system_checks = '__all__' args = ' ...' help = 'Charge le solde courant' diff --git a/eo_gestion/eo_banque/management/commands/solde.py b/eo_gestion/eo_banque/management/commands/solde.py index 7c159b5..4c33eab 100644 --- a/eo_gestion/eo_banque/management/commands/solde.py +++ b/eo_gestion/eo_banque/management/commands/solde.py @@ -13,7 +13,7 @@ class Command(BaseCommand): can_import_django_settings = True output_transaction = True - requires_system_checks = True + requires_system_checks = '__all__' args = ' ...' help = 'Charge le solde courant' diff --git a/eo_gestion/eo_banque/migrations/0001_initial.py b/eo_gestion/eo_banque/migrations/0001_initial.py index bf72023..ee519e7 100644 --- a/eo_gestion/eo_banque/migrations/0001_initial.py +++ b/eo_gestion/eo_banque/migrations/0001_initial.py @@ -2,7 +2,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('contenttypes', '0001_initial'), ] diff --git a/eo_gestion/eo_banque/migrations/0002_auto_20220502_1357.py b/eo_gestion/eo_banque/migrations/0002_auto_20220502_1357.py index 4b216f9..295489a 100644 --- a/eo_gestion/eo_banque/migrations/0002_auto_20220502_1357.py +++ b/eo_gestion/eo_banque/migrations/0002_auto_20220502_1357.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_banque', '0001_initial'), ] diff --git a/eo_gestion/eo_banque/templates/admin/eo_banque/lignebanquepop/change_form.html b/eo_gestion/eo_banque/templates/admin/eo_banque/lignebanquepop/change_form.html index 54b705d..6ea8f72 100644 --- a/eo_gestion/eo_banque/templates/admin/eo_banque/lignebanquepop/change_form.html +++ b/eo_gestion/eo_banque/templates/admin/eo_banque/lignebanquepop/change_form.html @@ -2,11 +2,11 @@ {% load i18n %} {% block object-tools %} -{% if change %}{% if not is_popup %} - -{% endif %}{% endif %} + {% if change %}{% if not is_popup %} + + {% endif %}{% endif %} {% endblock %} diff --git a/eo_gestion/eo_banque/templates/eo_banque/finances.html b/eo_gestion/eo_banque/templates/eo_banque/finances.html index c79b23b..3cc5663 100644 --- a/eo_gestion/eo_banque/templates/eo_banque/finances.html +++ b/eo_gestion/eo_banque/templates/eo_banque/finances.html @@ -1,18 +1,18 @@ {% load eo_facture %}
-

Finance

-

Solde: {{ solde|amountformat }} €

- +

Finance

+

Solde: {{ solde|amountformat }} €

+
- -{% for periode in finances %} - - - - - - -{% endfor %} - -
MoisEncaissementsDépensesSolde
{{ periode.date|date:"M Y" }}{{periode.encaissement|amountformat}} €{{periode.depense|amountformat}} €{{periode.solde|amountformat}} €
+ + {% for periode in finances %} + + {{ periode.date|date:"M Y" }} + {{periode.encaissement|amountformat}} € + {{periode.depense|amountformat}} € + {{periode.solde|amountformat}} € + + {% endfor %} + +
diff --git a/eo_gestion/eo_banque/templates/eo_banque/total.html b/eo_gestion/eo_banque/templates/eo_banque/total.html index e5d3490..2ae94d4 100644 --- a/eo_gestion/eo_banque/templates/eo_banque/total.html +++ b/eo_gestion/eo_banque/templates/eo_banque/total.html @@ -1,6 +1,6 @@ {% load eo_facture %}
-

Crédit: {{ credit|amountformat }} €

-

Débit: {{ debit|amountformat }} €

-

Total: {{ total|amountformat }} €

+

Crédit: {{ credit|amountformat }} €

+

Débit: {{ debit|amountformat }} €

+

Total: {{ total|amountformat }} €

diff --git a/eo_gestion/eo_facture/admin.py b/eo_gestion/eo_facture/admin.py index 4b5dec8..5f88b77 100644 --- a/eo_gestion/eo_facture/admin.py +++ b/eo_gestion/eo_facture/admin.py @@ -21,7 +21,6 @@ from io import BytesIO from adminsortable2.admin import SortableInlineAdminMixin from django import http -from django.conf.urls import url from django.contrib import admin from django.contrib.admin.options import BaseModelAdmin from django.contrib.humanize.templatetags.humanize import ordinal @@ -30,7 +29,7 @@ from django.db.models import Exists, OuterRef, TextField from django.forms import Textarea from django.forms.models import BaseInlineFormSet from django.shortcuts import render -from django.urls import path, reverse +from django.urls import path, re_path, reverse from django.utils.html import format_html import eo_gestion.admin @@ -210,6 +209,10 @@ class ClientAdmin(admin.ModelAdmin): css = {'all': ('css/client.css',)} +@admin.display( + description='Client', + ordering='client', +) def show_client(obj): if obj.client: url = reverse('admin:eo_facture_client_change', args=[obj.client.id]) @@ -218,10 +221,6 @@ def show_client(obj): return '' -show_client.short_description = 'Client' -show_client.admin_order_field = 'client' - - class MyContratsFilter(admin.SimpleListFilter): title = 'CPF' parameter_name = 'cpf' @@ -278,11 +277,10 @@ class ContratAdmin(LookupAllowed, admin.ModelAdmin): actions = [actions.export_references_as_fodt] autocomplete_fields = ['client'] + @admin.display(description='Montant') def column_montant(self, obj): return amountformat(obj.montant()) - column_montant.short_description = 'Montant' - def get_queryset(self, request): qs = super().get_queryset(request) return qs.prefetch_related('prestations', 'factures__lignes', 'tags') @@ -362,7 +360,7 @@ class ContratAdmin(LookupAllowed, admin.ModelAdmin): duplicate_view = self.admin_site.admin_view(self.duplicate) facturer_echeance_view = self.admin_site.admin_view(self.facturer_echeance) my_urls = [ - url(r'^(.+)/duplicate/$', duplicate_view, name='eo_facture_contrat_duplicate'), + re_path(r'^(.+)/duplicate/$', duplicate_view, name='eo_facture_contrat_duplicate'), path( '/facturer-echeance/', facturer_echeance_view, @@ -372,13 +370,11 @@ class ContratAdmin(LookupAllowed, admin.ModelAdmin): return my_urls + urls +@admin.display(description='Ordre') def index(facture): return format_html('{0}', ordinal(facture.index())) -index.short_description = 'Ordre' - - class FactureAdmin(LookupAllowed, admin.ModelAdmin): form = forms.FactureForm inlines = [LigneInline, PaymentInline] @@ -423,29 +419,25 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin): actions = [actions.export_invoices_as_zip] autocomplete_fields = ['client'] + @admin.display(description='Code') def column_code(self, obj): if obj.montant < 0: return 'Avoir %s' % obj.code() else: return obj.code() - column_code.short_description = 'Code' - + @admin.display(description='Montant') def column_montant(self, obj): return amountformat(obj.montant) - column_montant.short_description = 'Montant' - + @admin.display(description='Montant TTC') def column_montant_ttc(self, obj): return amountformat(obj.montant_ttc) - column_montant_ttc.short_description = 'Montant TTC' - + @admin.display(description='Solde') def column_solde(self, obj): return amountformat(obj.solde()) - column_solde.short_description = 'Solde' - def has_delete_permission(self, request, obj=None): # ne pas supprimer les factures émises if obj and not obj.proforma: @@ -521,29 +513,31 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin): def get_urls(self): urls = super().get_urls() my_urls = [ - url(r'^view/([^/]*)', views.facture), - url( - r'^add_simple/$', + re_path(r'^view/([^/]*)', views.facture), + path( + 'add_simple/', self.admin_site.admin_view(self.add_simple), name='eo_facture_facture_add_simple', ), - url( + re_path( r'^(.+)/view_pdf/', self.admin_site.admin_view(views.facture_pdf), name='eo_facture_facture_print', ), - url(r'^(.+)/view/$', self.admin_site.admin_view(views.facture), name='eo_facture_facture_html'), - url( + re_path( + r'^(.+)/view/$', self.admin_site.admin_view(views.facture), name='eo_facture_facture_html' + ), + re_path( r'^(.+)/send-to-chorus/', self.admin_site.admin_view(views.send_to_chorus), name='eo_facture_facture_send_to_chorus', ), - url( - r'^sheet/$', + path( + 'sheet/', self.admin_site.admin_view(self.sheet), name='eo_facture_facture_sheet', ), - url( + re_path( r'^(.+)/cancel/', self.admin_site.admin_view(views.cancel), name='eo_facture_facture_cancel', @@ -551,13 +545,13 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin): ] return my_urls + urls + @admin.display(description='Client') def show_client(self, obj): if obj.client: url = reverse('admin:eo_facture_client_change', args=[obj.client.id]) return format_html('{1}', url, obj.client) - show_client.short_description = 'Client' - + @admin.display(description='Contrat / Intitulé') def show_contrat(self, obj): if obj.contrat: url = reverse('admin:eo_facture_contrat_change', args=[obj.contrat.id]) @@ -567,8 +561,6 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin): return format_html('{1}', url, obj.contrat) return format_html('Pas de contrat
{0}', obj.intitule) - show_contrat.short_description = 'Contrat / Intitulé' - # adapt get_object and get_changelist_instance to produce and accept URL # with facture's code FACTURE_RE = re.compile('^F(?P20[0-9]{2})(?P[0-9]{4})$') diff --git a/eo_gestion/eo_facture/fields.py b/eo_gestion/eo_facture/fields.py index f85d3d8..1bf3792 100644 --- a/eo_gestion/eo_facture/fields.py +++ b/eo_gestion/eo_facture/fields.py @@ -21,7 +21,7 @@ from django import forms from django.core import validators from django.core.exceptions import ValidationError from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class PercentagePerYear(list): diff --git a/eo_gestion/eo_facture/migrations/0001_initial.py b/eo_gestion/eo_facture/migrations/0001_initial.py index 9e3f487..f0b1d86 100644 --- a/eo_gestion/eo_facture/migrations/0001_initial.py +++ b/eo_gestion/eo_facture/migrations/0001_initial.py @@ -9,7 +9,6 @@ import eo_gestion.eo_facture.models class Migration(migrations.Migration): - dependencies = [ ('eo_banque', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), diff --git a/eo_gestion/eo_facture/migrations/0002_facture_account_on_previous_period.py b/eo_gestion/eo_facture/migrations/0002_facture_account_on_previous_period.py index de8a8b8..d87fbda 100644 --- a/eo_gestion/eo_facture/migrations/0002_facture_account_on_previous_period.py +++ b/eo_gestion/eo_facture/migrations/0002_facture_account_on_previous_period.py @@ -2,7 +2,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0001_initial'), ] diff --git a/eo_gestion/eo_facture/migrations/0003_client_picture.py b/eo_gestion/eo_facture/migrations/0003_client_picture.py index 56b2faa..55df28b 100644 --- a/eo_gestion/eo_facture/migrations/0003_client_picture.py +++ b/eo_gestion/eo_facture/migrations/0003_client_picture.py @@ -19,7 +19,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0002_facture_account_on_previous_period'), ] diff --git a/eo_gestion/eo_facture/migrations/0004_contrat_public_description.py b/eo_gestion/eo_facture/migrations/0004_contrat_public_description.py index 8460a1b..93c9076 100644 --- a/eo_gestion/eo_facture/migrations/0004_contrat_public_description.py +++ b/eo_gestion/eo_facture/migrations/0004_contrat_public_description.py @@ -2,7 +2,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0003_client_picture'), ] diff --git a/eo_gestion/eo_facture/migrations/0005_contrat_image.py b/eo_gestion/eo_facture/migrations/0005_contrat_image.py index f251582..c3b851d 100644 --- a/eo_gestion/eo_facture/migrations/0005_contrat_image.py +++ b/eo_gestion/eo_facture/migrations/0005_contrat_image.py @@ -19,7 +19,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0004_contrat_public_description'), ] diff --git a/eo_gestion/eo_facture/migrations/0006_client_contacts.py b/eo_gestion/eo_facture/migrations/0006_client_contacts.py index 97514af..d07f843 100644 --- a/eo_gestion/eo_facture/migrations/0006_client_contacts.py +++ b/eo_gestion/eo_facture/migrations/0006_client_contacts.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0005_contrat_image'), ] diff --git a/eo_gestion/eo_facture/migrations/0007_auto_20191009_1335.py b/eo_gestion/eo_facture/migrations/0007_auto_20191009_1335.py index 9cc7aaa..455c803 100644 --- a/eo_gestion/eo_facture/migrations/0007_auto_20191009_1335.py +++ b/eo_gestion/eo_facture/migrations/0007_auto_20191009_1335.py @@ -21,7 +21,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0006_client_contacts'), ] diff --git a/eo_gestion/eo_facture/migrations/0008_auto_20200201_1559.py b/eo_gestion/eo_facture/migrations/0008_auto_20200201_1559.py index df93bab..632ec4e 100644 --- a/eo_gestion/eo_facture/migrations/0008_auto_20200201_1559.py +++ b/eo_gestion/eo_facture/migrations/0008_auto_20200201_1559.py @@ -6,7 +6,6 @@ import eo_gestion.eo_facture.validators class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0007_auto_20191009_1335'), ] diff --git a/eo_gestion/eo_facture/migrations/0009_client_chorus_structure.py b/eo_gestion/eo_facture/migrations/0009_client_chorus_structure.py index 8165c72..b7366c6 100644 --- a/eo_gestion/eo_facture/migrations/0009_client_chorus_structure.py +++ b/eo_gestion/eo_facture/migrations/0009_client_chorus_structure.py @@ -5,7 +5,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('chorus', '__first__'), ('eo_facture', '0008_auto_20200201_1559'), diff --git a/eo_gestion/eo_facture/migrations/0010_auto_20200316_1616.py b/eo_gestion/eo_facture/migrations/0010_auto_20200316_1616.py index 489371a..894eb1b 100644 --- a/eo_gestion/eo_facture/migrations/0010_auto_20200316_1616.py +++ b/eo_gestion/eo_facture/migrations/0010_auto_20200316_1616.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0009_client_chorus_structure'), ] diff --git a/eo_gestion/eo_facture/migrations/0011_contrat_url.py b/eo_gestion/eo_facture/migrations/0011_contrat_url.py index 9271f55..1e57782 100644 --- a/eo_gestion/eo_facture/migrations/0011_contrat_url.py +++ b/eo_gestion/eo_facture/migrations/0011_contrat_url.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0010_auto_20200316_1616'), ] diff --git a/eo_gestion/eo_facture/migrations/0012_client_active.py b/eo_gestion/eo_facture/migrations/0012_client_active.py index d096662..288df02 100644 --- a/eo_gestion/eo_facture/migrations/0012_client_active.py +++ b/eo_gestion/eo_facture/migrations/0012_client_active.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0011_contrat_url'), ] diff --git a/eo_gestion/eo_facture/migrations/0013_contrat_tags.py b/eo_gestion/eo_facture/migrations/0013_contrat_tags.py index 969d4af..7a9641c 100644 --- a/eo_gestion/eo_facture/migrations/0013_contrat_tags.py +++ b/eo_gestion/eo_facture/migrations/0013_contrat_tags.py @@ -6,7 +6,6 @@ import eo_gestion.eo_facture.taggit class Migration(migrations.Migration): - dependencies = [ ('taggit', '0002_auto_20150616_2121'), ('eo_facture', '0012_client_active'), diff --git a/eo_gestion/eo_facture/migrations/0014_facture_annulation.py b/eo_gestion/eo_facture/migrations/0014_facture_annulation.py index 5e6bbba..5d83021 100644 --- a/eo_gestion/eo_facture/migrations/0014_facture_annulation.py +++ b/eo_gestion/eo_facture/migrations/0014_facture_annulation.py @@ -5,7 +5,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0013_contrat_tags'), ] diff --git a/eo_gestion/eo_facture/migrations/0015_add_fields_for_periodic_invoicing.py b/eo_gestion/eo_facture/migrations/0015_add_fields_for_periodic_invoicing.py index 6734abf..74377e9 100644 --- a/eo_gestion/eo_facture/migrations/0015_add_fields_for_periodic_invoicing.py +++ b/eo_gestion/eo_facture/migrations/0015_add_fields_for_periodic_invoicing.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0014_facture_annulation'), ] diff --git a/eo_gestion/eo_facture/migrations/0016_auto_20220518_1824.py b/eo_gestion/eo_facture/migrations/0016_auto_20220518_1824.py index a95dcca..28b23f3 100644 --- a/eo_gestion/eo_facture/migrations/0016_auto_20220518_1824.py +++ b/eo_gestion/eo_facture/migrations/0016_auto_20220518_1824.py @@ -6,7 +6,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0015_add_fields_for_periodic_invoicing'), ] diff --git a/eo_gestion/eo_facture/migrations/0017_auto_20220518_1827.py b/eo_gestion/eo_facture/migrations/0017_auto_20220518_1827.py index d5cbf2f..18efaed 100644 --- a/eo_gestion/eo_facture/migrations/0017_auto_20220518_1827.py +++ b/eo_gestion/eo_facture/migrations/0017_auto_20220518_1827.py @@ -6,7 +6,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0016_auto_20220518_1824'), ] diff --git a/eo_gestion/eo_facture/migrations/0018_client_notes_privees.py b/eo_gestion/eo_facture/migrations/0018_client_notes_privees.py index c5eaa78..8093960 100644 --- a/eo_gestion/eo_facture/migrations/0018_client_notes_privees.py +++ b/eo_gestion/eo_facture/migrations/0018_client_notes_privees.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0017_auto_20220518_1827'), ] diff --git a/eo_gestion/eo_facture/migrations/0019_alter_contrat_client.py b/eo_gestion/eo_facture/migrations/0019_alter_contrat_client.py index 796a159..40da74f 100644 --- a/eo_gestion/eo_facture/migrations/0019_alter_contrat_client.py +++ b/eo_gestion/eo_facture/migrations/0019_alter_contrat_client.py @@ -5,7 +5,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0018_client_notes_privees'), ] diff --git a/eo_gestion/eo_facture/migrations/0020_facture_accounting_year.py b/eo_gestion/eo_facture/migrations/0020_facture_accounting_year.py index 8aea527..1412b2c 100644 --- a/eo_gestion/eo_facture/migrations/0020_facture_accounting_year.py +++ b/eo_gestion/eo_facture/migrations/0020_facture_accounting_year.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0019_alter_contrat_client'), ] diff --git a/eo_gestion/eo_facture/migrations/0022_auto_20240111_1328.py b/eo_gestion/eo_facture/migrations/0022_auto_20240111_1328.py index 19cf201..0d67948 100644 --- a/eo_gestion/eo_facture/migrations/0022_auto_20240111_1328.py +++ b/eo_gestion/eo_facture/migrations/0022_auto_20240111_1328.py @@ -6,7 +6,6 @@ import eo_gestion.eo_facture.models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0021_migrate_data_to_accounting_year'), ] diff --git a/eo_gestion/eo_facture/models.py b/eo_gestion/eo_facture/models.py index 2986352..e744f7b 100644 --- a/eo_gestion/eo_facture/models.py +++ b/eo_gestion/eo_facture/models.py @@ -34,7 +34,7 @@ from django.db.models.query import QuerySet from django.db.models.signals import post_delete, post_save from django.template.loader import get_template from django.utils.timezone import now -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from weasyprint import HTML from eo_gestion.utils import percentage_str diff --git a/eo_gestion/eo_facture/templates/admin/eo_facture/client/change_form.html b/eo_gestion/eo_facture/templates/admin/eo_facture/client/change_form.html index 76c121f..f87e22d 100644 --- a/eo_gestion/eo_facture/templates/admin/eo_facture/client/change_form.html +++ b/eo_gestion/eo_facture/templates/admin/eo_facture/client/change_form.html @@ -2,13 +2,13 @@ {% load admin_urls i18n %} {% block object-tools %} -{% if change %}{% if not is_popup %} - {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} - -{% endif %}{% endif %} + {% if change %}{% if not is_popup %} + {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} + + {% endif %}{% endif %} {% endblock %} diff --git a/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/change_form.html b/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/change_form.html index de5efde..2075ea3 100644 --- a/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/change_form.html +++ b/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/change_form.html @@ -2,41 +2,41 @@ {% load admin_urls i18n %} {% block object-tools %} -{% if change %}{% if not is_popup %} - {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} - -{% endif %}{% endif %} + {% if change %}{% if not is_popup %} + {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} + + {% endif %}{% endif %} {% endblock %} {% block after_field_sets %} -{% if original.periodicite and original.periodicite_debut %} -
-

Échéances

-
+ {% if original.periodicite and original.periodicite_debut %} +
+

Échéances

+
    - {% for echeance in original.periodicite_echeances %} -
  • du {{ echeance.1 }} au {{ echeance.2 }}
  • - {% endfor %} + {% for echeance in original.periodicite_echeances %} +
  • du {{ echeance.1 }} au {{ echeance.2 }}
  • + {% endfor %}
-
-
-{% endif %} +
+
+ {% endif %} {% endblock %} diff --git a/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/duplicate.html b/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/duplicate.html index c02a560..e03f486 100644 --- a/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/duplicate.html +++ b/eo_gestion/eo_facture/templates/admin/eo_facture/contrat/duplicate.html @@ -2,14 +2,14 @@ {% load i18n admin_modify static %} {% block extrahead %}{{ block.super }} -{% url "admin:jsi18n" as jsi18nurl %} - -{{ media }} + {% url "admin:jsi18n" as jsi18nurl %} + + {{ media }} {% endblock %} {% block extrastyle %} -{{ block.super }} - + {{ block.super }} + {% endblock %} {% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %} @@ -17,30 +17,30 @@ {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} {% block breadcrumbs %}{% if not is_popup %} - + {% endif %}{% endblock %} {% block content %}
-
{% csrf_token %} -
-{% if errors %} -

- {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} -

- {{ adminform.form.non_field_errors }} -{% endif %} - - {{ form.as_table }} -
- + {% csrf_token %} +
+ {% if errors %} +

+ {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} +

+ {{ adminform.form.non_field_errors }} + {% endif %} + + {{ form.as_table }} +
+ -
-
+
+ {% endblock %} diff --git a/eo_gestion/eo_facture/templates/admin/eo_facture/facture/add_simple.html b/eo_gestion/eo_facture/templates/admin/eo_facture/facture/add_simple.html index 1491612..322ce37 100644 --- a/eo_gestion/eo_facture/templates/admin/eo_facture/facture/add_simple.html +++ b/eo_gestion/eo_facture/templates/admin/eo_facture/facture/add_simple.html @@ -3,9 +3,9 @@ {% load static %} {% block extrahead %}{{ block.super }} -{% url "admin:jsi18n" as jsi18nurl %} - -{{ media }} + {% url "admin:jsi18n" as jsi18nurl %} + + {{ media }} {% endblock %} {% block extrastyle %}{{ block.super }}{% endblock %} @@ -15,31 +15,31 @@ {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} {% block breadcrumbs %}{% if not is_popup %} - + {% endif %}{% endblock %} {% block content %}
-
{% csrf_token %} -
-{% if errors %} -

- {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} -

- {{ adminform.form.non_field_errors }} -{% endif %} - - {{ form.as_table }} -
- + {% csrf_token %} +
+ {% if errors %} +

+ {% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} +

+ {{ adminform.form.non_field_errors }} + {% endif %} + + {{ form.as_table }} +
+ -
-
+
+ {% endblock %} diff --git a/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_form.html b/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_form.html index dd83c63..e5f9c46 100644 --- a/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_form.html +++ b/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_form.html @@ -2,45 +2,45 @@ {% load admin_urls i18n %} {% block extrahead %}{{ block.super }} -{% if add and not original.client %} -{% if not original.contrat or original.contrat.client %} - -{% endif %} -{% endif %} + {% if add and not original.client %} + {% if not original.contrat or original.contrat.client %} + + {% endif %} + {% endif %} {% endblock %} {% block object-tools %} -{% if change %}{% if not is_popup %} -
    - {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} -
  • {% trans "History" %}
  • - {% if original.client %} -
  • Client
  • - {% endif %} - {% if original.contrat %} -
  • Contrat
  • - {% endif %} -
  • Imprimer
  • - {% if original.client.chorus_structure and not original.proforma %} -
  • Envoyer à Chorus
  • - {% endif %} - {% if not original.annulation and original.factures_avoir.count == 0 %} -
  • Annuler
  • - {% endif %} -
-{% endif %}{% endif %} + {% if change %}{% if not is_popup %} +
    + {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} +
  • {% trans "History" %}
  • + {% if original.client %} +
  • Client
  • + {% endif %} + {% if original.contrat %} +
  • Contrat
  • + {% endif %} +
  • Imprimer
  • + {% if original.client.chorus_structure and not original.proforma %} +
  • Envoyer à Chorus
  • + {% endif %} + {% if not original.annulation and original.factures_avoir.count == 0 %} +
  • Annuler
  • + {% endif %} +
+ {% endif %}{% endif %} {% endblock %} diff --git a/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_list.html b/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_list.html index 5fb5d92..fca0967 100644 --- a/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_list.html +++ b/eo_gestion/eo_facture/templates/admin/eo_facture/facture/change_list.html @@ -10,7 +10,7 @@
  • - Rapid' facture + Rapid' facture
  • Export ODS
  • diff --git a/eo_gestion/eo_facture/templates/eo_facture/a_facturer.html b/eo_gestion/eo_facture/templates/eo_facture/a_facturer.html index 1ac315f..e78b5d7 100644 --- a/eo_gestion/eo_facture/templates/eo_facture/a_facturer.html +++ b/eo_gestion/eo_facture/templates/eo_facture/a_facturer.html @@ -1,29 +1,29 @@ {% load eo_facture %} {% if a_facturer %} -
    -

    Reste à facturer

    -

    Liste des contrats qu'on a pas facturés depuis un bon moment et pour lesquels il reste un solde à facturer.

    -

    Montant total: {{ montant|amountformat }} € HT

    - - - - - - - - - {% for l in a_facturer %} - - - - - - - {% endfor %} -
    ContratPourcentage facturéReste HTDepuis
    - - {{ l.contrat.intitule }} - - {{ l.pourcentage|floatformat:2 }} %{{ l.montant|amountformat }} €{{ l.depuis }} jours
    -
    +
    +

    Reste à facturer

    +

    Liste des contrats qu'on a pas facturés depuis un bon moment et pour lesquels il reste un solde à facturer.

    +

    Montant total: {{ montant|amountformat }} € HT

    + + + + + + + + + {% for l in a_facturer %} + + + + + + + {% endfor %} +
    ContratPourcentage facturéReste HTDepuis
    + + {{ l.contrat.intitule }} + + {{ l.pourcentage|floatformat:2 }} %{{ l.montant|amountformat }} €{{ l.depuis }} jours
    +
    {% endif %} diff --git a/eo_gestion/eo_facture/templates/eo_facture/echeances.html b/eo_gestion/eo_facture/templates/eo_facture/echeances.html index 5b54c6e..f502890 100644 --- a/eo_gestion/eo_facture/templates/eo_facture/echeances.html +++ b/eo_gestion/eo_facture/templates/eo_facture/echeances.html @@ -1,45 +1,45 @@ {% load eo_facture %} {% if echeances %} -
    -

    Contrats récurrents à facturer

    +
    +

    Contrats récurrents à facturer

    - - - - - - - - - +
    + + + + + + + + - - - {% for echeance in echeances %} - - - - - - - + {% for echeance in echeances %} + + + + + + + - - {% endfor %} -
    Date anniversaire Client Contrat Échéance Périodicité
    {{ echeance.debut|date:"d/m/Y" }} - {{ echeance.fin|date:"d/m/Y" }}{{ echeance.contrat.client }} - - {{ echeance.contrat.intitule }} - - {{ echeance.occurrence }} / {{ echeance.contrat.periodicite_nombre_d_echeances }}{{ echeance.contrat.get_periodicite_display }} -
    + +
    {{ echeance.debut|date:"d/m/Y" }} - {{ echeance.fin|date:"d/m/Y" }}{{ echeance.contrat.client }} + + {{ echeance.contrat.intitule }} + + {{ echeance.occurrence }} / {{ echeance.contrat.periodicite_nombre_d_echeances }}{{ echeance.contrat.get_periodicite_display }} + {% csrf_token %} - -
    -
    + + + + {% endfor %} + +
    {% endif %} diff --git a/eo_gestion/eo_facture/templates/eo_facture/impayee.html b/eo_gestion/eo_facture/templates/eo_facture/impayee.html index 13ed88d..6a1520c 100644 --- a/eo_gestion/eo_facture/templates/eo_facture/impayee.html +++ b/eo_gestion/eo_facture/templates/eo_facture/impayee.html @@ -1,35 +1,35 @@ {% load eo_facture %} {% if factures %} -
    -

    Impayées

    -

    Montant total: {{ montant|amountformat }} € TTC ({{montant_ht|amountformat}} € HT)

    - - - - - - -{% for l in factures %} -{% with l.facture as facture %} - - - -{% if l.encaissements %} -{% for encaissement in l.encaissements %} - - - - -{% endfor %} -{% endif %} -{% endwith %} -{% endfor %} - -
    Quoi?Depuis...
    - -{{facture.emission|ago}}
    - {{ encaissement.libelle }} - {{ encaissement.reference }} - payé le {{ encaissement.date_valeur }} de {{ encaissement.montant|amountformat }} € - Accepter -
    -
    +
    +

    Impayées

    +

    Montant total: {{ montant|amountformat }} € TTC ({{montant_ht|amountformat}} € HT)

    + + + + + + + {% for l in factures %} + {% with l.facture as facture %} + + + + {% if l.encaissements %} + {% for encaissement in l.encaissements %} + + + + + {% endfor %} + {% endif %} + {% endwith %} + {% endfor %} + +
    Quoi?Depuis...
    + + {{facture.emission|ago}}
    + {{ encaissement.libelle }} - {{ encaissement.reference }} - payé le {{ encaissement.date_valeur }} de {{ encaissement.montant|amountformat }} € + Accepter +
    +
    {% endif %} diff --git a/eo_gestion/eo_facture/templates/eo_facture/income.html b/eo_gestion/eo_facture/templates/eo_facture/income.html index 6b63202..a7012e9 100644 --- a/eo_gestion/eo_facture/templates/eo_facture/income.html +++ b/eo_gestion/eo_facture/templates/eo_facture/income.html @@ -1,47 +1,47 @@ {% load eo_facture %}
    - +
    - - - - {% for i in income_by_year %} - - {% endfor %} - - - - - - {% for i in income_by_year %} - - {% endfor %} - - - - {% for i in income_by_year %} - - {% endfor %} - - - - {% for i in income_by_year %} - - {% endfor %} - - - - {% for i in income_by_year %} - - {% endfor %} - - - - {% for i in income_by_year %} - - {% endfor %} - - -
    Chiffre d'affaire par an
    Année{{ i.year }}
    Encaissé{{ i.paid|amountformat }}
    Facturé{{ i.invoiced|amountformat }}
    Contracté{{ i.contracted|amountformat }}
    Sous-traité{{ i.sous_traite|amountformat }}
    Total{{ i.total|amountformat }}
    + + + Année + {% for i in income_by_year %} + {{ i.year }} + {% endfor %} + + + + + Encaissé + {% for i in income_by_year %} + {{ i.paid|amountformat }} + {% endfor %} + + + Facturé + {% for i in income_by_year %} + {{ i.invoiced|amountformat }} + {% endfor %} + + + Contracté + {% for i in income_by_year %} + {{ i.contracted|amountformat }} + {% endfor %} + + + Sous-traité + {% for i in income_by_year %} + {{ i.sous_traite|amountformat }} + {% endfor %} + + + Total + {% for i in income_by_year %} + {{ i.total|amountformat }} + {% endfor %} + + +
    diff --git a/eo_gestion/eo_facture/templates/eo_facture/table.html b/eo_gestion/eo_facture/templates/eo_facture/table.html index 10387de..335ce41 100644 --- a/eo_gestion/eo_facture/templates/eo_facture/table.html +++ b/eo_gestion/eo_facture/templates/eo_facture/table.html @@ -1,31 +1,31 @@ {% load eo_facture %}
    - +
    - {% for header, header_title in headers %} + {% for header, header_title in headers %} - {% endfor %} + {% endfor %} - {% for row in table %} + {% for row in table %} - {% if row.0.href %} - - {% else %} - - {% endif %} - - - - - - - + {% if row.0.href %} + + {% else %} + + {% endif %} + + + + + + + - {% endfor %} + {% endfor %} - +
    {{title}}
    {{header_title}}
    {{ row.0 }}{{ row.0 }}{{ row.1|amountformat }}{{ row.2|amountformat }}{{ row.3|floatformat:2 }} %{{ row.4|amountformat }}{{ row.5|floatformat:2 }} %{{ row.6|floatformat:2 }} %{{ row.7|floatformat:2 }}{{ row.0 }}{{ row.0 }}{{ row.1|amountformat }}{{ row.2|amountformat }}{{ row.3|floatformat:2 }} %{{ row.4|amountformat }}{{ row.5|floatformat:2 }} %{{ row.6|floatformat:2 }} %{{ row.7|floatformat:2 }}
    diff --git a/eo_gestion/eo_facture/templates/facture.html b/eo_gestion/eo_facture/templates/facture.html index b06eabc..885ca59 100644 --- a/eo_gestion/eo_facture/templates/facture.html +++ b/eo_gestion/eo_facture/templates/facture.html @@ -1,81 +1,81 @@ {% load eo_facture %} - - {% if base_uri %}{% endif %} - - Facture {{facture.code}} - {{facture.intitule}} - - - - -
    {% if facture.proforma %}{% else %} -{% endif %} -{% if facture.annulation %} - - - - -{% endif %} - -
    Devisn°{{ facture.id }}Facture{{facture.code}}
    Annule{% if facture.annulation.proforma %}devis n°{{facture.annulation.id}}{% else %}{{ facture.annulation.code }}{% endif %}
    Date{{ facture.emission|date:'d/m/Y' }}
    {% if facture.proforma %}Valable jusqu'au{% else %}Échéance{% endif %}{{ facture.echeance|date:'d/m/Y' }}
    + + {% if base_uri %}{% endif %} + + Facture {{facture.code}} - {{facture.intitule}} + + + + +
    {% if facture.proforma %}{% else %} + {% endif %} + {% if facture.annulation %} + + + + + {% endif %} + +
    Devisn°{{ facture.id }}Facture{{facture.code}}
    Annule{% if facture.annulation.proforma %}devis n°{{facture.annulation.id}}{% else %}{{ facture.annulation.code }}{% endif %}
    Date{{ facture.emission|date:'d/m/Y' }}
    {% if facture.proforma %}Valable jusqu'au{% else %}Échéance{% endif %}{{ facture.echeance|date:'d/m/Y' }}
    -
    -Société Coopérative et Participative -SARL au capital variable de 15200 € -169 rue du château -75014 PARIS -FRANCE +
    + Société Coopérative et Participative + SARL au capital variable de 15200 € + 169 rue du château + 75014 PARIS + FRANCE -Tél : 01 43 35 01 35 -Email : gerant@entrouvert.com -Web : https://www.entrouvert.com -RCS : Paris -NAF/APE : 6201Z -SIRET : 443 170 139 00036 -Numéro TVA : FR 08443170139
    -
    {{ facture.client.nom }}
    -{{ facture.client.adresse|linebreaksbr }} -
    + Tél : 01 43 35 01 35 + Email : gerant@entrouvert.com + Web : https://www.entrouvert.com + RCS : Paris + NAF/APE : 6201Z + SIRET : 443 170 139 00036 + Numéro TVA : FR 08443170139
    +
    {{ facture.client.nom }}
    + {{ facture.client.adresse|linebreaksbr }} +
    -
    -

    {{ facture.intitule }}

    -

    {{ facture.notes }}

    - - - - {% for ligne in facture.lignes.all %} - - - - - - - {% endfor %} - - - - - - -
    DescriptionQuantitéPrix unitairePrix HT
    {{ ligne.intitule }}{{ ligne.quantite|floatformat:2 }}{{ ligne.prix_unitaire_ht|amountformat }}{{ ligne.montant|amountformat }}
    Sous-total :{{ facture.montant|amountformat }}
    Total TVA (à {{facture.taux_tva|floatformat:2 }} %) :{{ facture.tva|amountformat }}
    Total TTC :{{ facture.montant_ttc|amountformat }}
    -

    Paiement total de {{ facture.montant_ttc|amountformat }} {{ facture.contrat.client.monnaie }} à verser au nom d'Entr'ouvert.

    -

    Mode de paiement : virement

    -
    - + + diff --git a/eo_gestion/eo_facture/templates/tag_widget.html b/eo_gestion/eo_facture/templates/tag_widget.html index 01bb170..1f9f1b2 100644 --- a/eo_gestion/eo_facture/templates/tag_widget.html +++ b/eo_gestion/eo_facture/templates/tag_widget.html @@ -1,7 +1,7 @@ {% load gadjo %}{% include "django/forms/widgets/select.html" %} - + diff --git a/eo_gestion/eo_facture/templatetags/eo_facture.py b/eo_gestion/eo_facture/templatetags/eo_facture.py index 0535d6e..8f484a5 100644 --- a/eo_gestion/eo_facture/templatetags/eo_facture.py +++ b/eo_gestion/eo_facture/templatetags/eo_facture.py @@ -180,7 +180,6 @@ def income_by_clients(user=None, year=None): for contrat in contrats.select_related('client').prefetch_related( 'factures', 'factures__lignes', 'prestations' ): - # how much as already been invoiced before previsions adjust = 0 invoiced = 0 diff --git a/eo_gestion/eo_facture/validators.py b/eo_gestion/eo_facture/validators.py index 5a37e0f..d4850ae 100644 --- a/eo_gestion/eo_facture/validators.py +++ b/eo_gestion/eo_facture/validators.py @@ -15,7 +15,7 @@ # along with this program. If not, see . from django.core.exceptions import ValidationError -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ def validate_luhn(string_value, length=None): diff --git a/eo_gestion/eo_redmine/migrations/0001_initial.py b/eo_gestion/eo_redmine/migrations/0001_initial.py index d2b40d4..ab9cf73 100644 --- a/eo_gestion/eo_redmine/migrations/0001_initial.py +++ b/eo_gestion/eo_redmine/migrations/0001_initial.py @@ -5,7 +5,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/eo_gestion/eo_redmine/migrations/0002_auto_20231108_1617.py b/eo_gestion/eo_redmine/migrations/0002_auto_20231108_1617.py index feba170..ec530de 100644 --- a/eo_gestion/eo_redmine/migrations/0002_auto_20231108_1617.py +++ b/eo_gestion/eo_redmine/migrations/0002_auto_20231108_1617.py @@ -6,7 +6,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('eo_facture', '0019_alter_contrat_client'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), diff --git a/eo_gestion/ods.py b/eo_gestion/ods.py index 6119281..a6bc8a6 100644 --- a/eo_gestion/ods.py +++ b/eo_gestion/ods.py @@ -19,7 +19,7 @@ import xml.etree.ElementTree as ET import zipfile from datetime import date, datetime -from django.utils.encoding import force_text +from django.utils.encoding import force_str NS = { 'fo': 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0', @@ -188,7 +188,7 @@ class WorkCell: value = '' self.worksheet = worksheet self.native_value = value - value = force_text(value) + value = force_str(value) for i in range(0x20): # remove control characters char = chr(i) if char in ('\t', '\r', '\n'): diff --git a/eo_gestion/settings.py b/eo_gestion/settings.py index 8c4d7f6..0c0fb9e 100644 --- a/eo_gestion/settings.py +++ b/eo_gestion/settings.py @@ -29,7 +29,7 @@ ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'barbacompta', 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. diff --git a/eo_gestion/templates/404.html b/eo_gestion/templates/404.html index 1ebada7..47298db 100644 --- a/eo_gestion/templates/404.html +++ b/eo_gestion/templates/404.html @@ -5,8 +5,8 @@ {% block content %} -

    {% trans "Error: page not found" %}

    +

    {% trans "Error: page not found" %}

    -

    {% trans "The page you requested has not been found on this server." %} +

    {% trans "The page you requested has not been found on this server." %} {% endblock %} diff --git a/eo_gestion/templates/500.html b/eo_gestion/templates/500.html index e44576f..5daa8d0 100644 --- a/eo_gestion/templates/500.html +++ b/eo_gestion/templates/500.html @@ -5,8 +5,8 @@ {% block content %} -

    {% trans "Server Error" %}

    +

    {% trans "Server Error" %}

    -

    {% trans "We're sorry but a server error has occurred." %} +

    {% trans "We're sorry but a server error has occurred." %} {% endblock %} diff --git a/eo_gestion/templates/admin/base_site.html b/eo_gestion/templates/admin/base_site.html index 4166342..b4a4c32 100644 --- a/eo_gestion/templates/admin/base_site.html +++ b/eo_gestion/templates/admin/base_site.html @@ -4,28 +4,28 @@ {% block title %}{{ title }} | {% trans "Entr'ouvert Gestion" %}{% endblock %} {% block branding %} -

    {% trans "Entr'ouvert Gestion" %}

    +

    {% trans "Entr'ouvert Gestion" %}

    {% endblock %} {% block extrastyle %} -{{ block.super }} - - + {{ block.super }} + + {% endblock %} {% block content_title %}

    Gestion de la facturation et des finances

    {% endblock %} {% block nav-global %} - + {% endblock %} {% block userlinks %} -{% trans 'Log out' %} + {% trans 'Log out' %} {% endblock %} diff --git a/eo_gestion/templates/admin/eo_banque/lignebanquepop/change_list.html b/eo_gestion/templates/admin/eo_banque/lignebanquepop/change_list.html index 1bdde1c..da65f48 100644 --- a/eo_gestion/templates/admin/eo_banque/lignebanquepop/change_list.html +++ b/eo_gestion/templates/admin/eo_banque/lignebanquepop/change_list.html @@ -2,12 +2,12 @@ {% load i18n %} {% load eo_banque %} {% block date_hierarchy %} -{{ block.super }} -{% eo_banque_date_hierarchy cl %} + {{ block.super }} + {% eo_banque_date_hierarchy cl %} {% endblock %} {% block pagination %} -{% total %} -{{ block.super }} + {% total %} + {{ block.super }} {% endblock %} {% block object-tools %} {% endblock %} diff --git a/eo_gestion/templates/admin/index.html b/eo_gestion/templates/admin/index.html index 1ea40a0..393fdbf 100644 --- a/eo_gestion/templates/admin/index.html +++ b/eo_gestion/templates/admin/index.html @@ -5,25 +5,25 @@ {% block content %} -
    -{% echeances %} +
    + {% echeances %} -{% if 'cpf' in request.GET %} -Afficher tout le monde
    - {% if request.GET.cpf == 'True' %} + {% if 'cpf' in request.GET %} + Afficher tout le monde
    + {% if request.GET.cpf == 'True' %} {% income_by_clients user %} - {% else %} + {% else %} {% income_by_clients %} + {% endif %} + {% else %} + N'afficher que mes clients
    + {% income_by_clients %} {% endif %} -{% else %} -N'afficher que mes clients
    - {% income_by_clients %} -{% endif %} -{% impayees %} -{% a_facturer %} -{% finances 8 %} -
    + {% impayees %} + {% a_facturer %} + {% finances 8 %} +
    {% endblock %} {% block sidebar_module %} -{% income %} + {% income %} {% endblock %} diff --git a/eo_gestion/templates/admin/old_index.html b/eo_gestion/templates/admin/old_index.html index 7a25046..b9aff65 100644 --- a/eo_gestion/templates/admin/old_index.html +++ b/eo_gestion/templates/admin/old_index.html @@ -11,72 +11,72 @@ {% block breadcrumbs %}{% endblock %} {% block content %} -
    +
    -{% if app_list %} - {% for app in app_list %} + {% if app_list %} + {% for app in app_list %}
    - - - {% for model in app.models %} - - {% if model.perms.change %} - - {% else %} - - {% endif %} +
    {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
    {{ model.name }}{{ model.name }}
    + + {% for model in app.models %} + + {% if model.perms.change %} + + {% else %} + + {% endif %} - {% if model.perms.add %} - - {% else %} - - {% endif %} + {% if model.perms.add %} + + {% else %} + + {% endif %} - {% if model.perms.change %} - - {% else %} - - {% endif %} - - {% endfor %} -
    {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
    {{ model.name }}{{ model.name }}{% trans 'Add' %} {% trans 'Add' %} {% trans 'Change' %} 
    + {% if model.perms.change %} + {% trans 'Change' %} + {% else %} +   + {% endif %} + + {% endfor %} +
    - {% endfor %} -{% else %} -

    {% trans "You don't have permission to edit anything." %}

    -{% endif %} -
    + {% endfor %} + {% else %} +

    {% trans "You don't have permission to edit anything." %}

    + {% endif %} +
    {% endblock %} {% block sidebar %} - {% endblock %} diff --git a/eo_gestion/urls.py b/eo_gestion/urls.py index 9895c64..24beed6 100644 --- a/eo_gestion/urls.py +++ b/eo_gestion/urls.py @@ -17,7 +17,7 @@ import django.contrib.admin from django.conf import settings -from django.conf.urls import include, url +from django.urls import include, path, re_path from django.views.generic.base import RedirectView from . import admin @@ -26,12 +26,12 @@ from .eo_facture.views import api_references django.contrib.admin.autodiscover() urlpatterns = [ - url(r'^favicon.ico', RedirectView.as_view(), {'url': '/static/img/favicon.ico'}), - url(r'^api/references/$', api_references), - url(r'^', admin.site.urls), + re_path(r'^favicon.ico', RedirectView.as_view(), {'url': '/static/img/favicon.ico'}), + path('api/references/', api_references), + re_path(r'^', admin.site.urls), ] if 'mellon' in settings.INSTALLED_APPS: urlpatterns = [ - url(r'^accounts/mellon/', include('mellon.urls')), + path('accounts/mellon/', include('mellon.urls')), ] + urlpatterns diff --git a/eo_gestion/vendor/adminsortable2/admin.py b/eo_gestion/vendor/adminsortable2/admin.py index 29646bf..1e3953e 100644 --- a/eo_gestion/vendor/adminsortable2/admin.py +++ b/eo_gestion/vendor/adminsortable2/admin.py @@ -253,31 +253,26 @@ class SortableAdminMixin(SortableAdminBase): setattr(obj, self.default_order_field, self.get_max_order(request, obj) + 1) super().save_model(request, obj, form, change) + @admin.action(description=_('Move selected to specific page')) def move_to_exact_page(self, request, queryset): self._bulk_move(request, queryset, self.EXACT) - move_to_exact_page.short_description = _('Move selected to specific page') - + @admin.action(description=_('Move selected ... pages back')) def move_to_back_page(self, request, queryset): self._bulk_move(request, queryset, self.BACK) - move_to_back_page.short_description = _('Move selected ... pages back') - + @admin.action(description=_('Move selected ... pages forward')) def move_to_forward_page(self, request, queryset): self._bulk_move(request, queryset, self.FORWARD) - move_to_forward_page.short_description = _('Move selected ... pages forward') - + @admin.action(description=_('Move selected to first page')) def move_to_first_page(self, request, queryset): self._bulk_move(request, queryset, self.FIRST) - move_to_first_page.short_description = _('Move selected to first page') - + @admin.action(description=_('Move selected to last page')) def move_to_last_page(self, request, queryset): self._bulk_move(request, queryset, self.LAST) - move_to_last_page.short_description = _('Move selected to last page') - def _move_item(self, request, startorder, endorder): extra_model_filters = self.get_extra_model_filters(request) return self.move_item(startorder, endorder, extra_model_filters) @@ -312,7 +307,6 @@ class SortableAdminMixin(SortableAdminBase): try: obj = model.objects.get(**obj_filters) except model.MultipleObjectsReturned: - # noinspection PyProtectedMember raise model.MultipleObjectsReturned( "Detected non-unique values in field '{rank_field}' used for sorting this model.\n" diff --git a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/change_list.html b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/change_list.html index 88b1c91..c34ab19 100644 --- a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/change_list.html +++ b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/change_list.html @@ -1,13 +1,13 @@ {% extends "admin/change_list.html" %} {% block extrahead %} - {{ block.super }} - + {{ block.super }} + {% endblock %} diff --git a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/includes/fieldset.html b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/includes/fieldset.html index 77c5229..ecb7ced 100644 --- a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/includes/fieldset.html +++ b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/includes/fieldset.html @@ -1,32 +1,32 @@
    - {% if fieldset.name %}

    {{ fieldset.name }}

    {% endif %} - {% if fieldset.description %} -
    {{ fieldset.description|safe }}
    - {% endif %} - {% for line in fieldset %} + {% if fieldset.name %}

    {{ fieldset.name }}

    {% endif %} + {% if fieldset.description %} +
    {{ fieldset.description|safe }}
    + {% endif %} + {% for line in fieldset %} {# Its an ugly hack to hide hidden input fields using style "display: none;", but unless https://code.djangoproject.com/ticket/11277 is solved, it currently the only possible workaround #} -
    - {% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %} - {% for field in line %} - {% if field.field.is_hidden %}{{ field.field }}{% else %} - - {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} - {% if field.is_checkbox %} - {{ field.field }}{{ field.label_tag }} - {% else %} - {{ field.label_tag }} - {% if field.is_readonly %} -

    {{ field.contents|linebreaksbr }}

    - {% else %} - {{ field.field }} - {% endif %} - {% endif %} - {% if field.field.help_text %} -

    {{ field.field.help_text|safe }}

    - {% endif %} -
    - {% endif %} - {% endfor %} - - {% endfor %} +
    + {% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %} + {% for field in line %} + {% if field.field.is_hidden %}{{ field.field }}{% else %} + + {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} + {% if field.is_checkbox %} + {{ field.field }}{{ field.label_tag }} + {% else %} + {{ field.label_tag }} + {% if field.is_readonly %} +

    {{ field.contents|linebreaksbr }}

    + {% else %} + {{ field.field }} + {% endif %} + {% endif %} + {% if field.field.help_text %} +

    {{ field.field.help_text|safe }}

    + {% endif %} +
    + {% endif %} + {% endfor %} + + {% endfor %}
    diff --git a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/stacked.html b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/stacked.html index 6f8ac5a..8ec3402 100644 --- a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/stacked.html +++ b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/stacked.html @@ -1,31 +1,31 @@ {% load i18n admin_urls static %}
    -
    -

    {{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

    -{{ inline_admin_formset.formset.management_form }} -{{ inline_admin_formset.formset.non_form_errors }} +
    +

    {{ inline_admin_formset.opts.verbose_name_plural|capfirst }}

    + {{ inline_admin_formset.formset.management_form }} + {{ inline_admin_formset.formset.non_form_errors }} -{% for inline_admin_form in inline_admin_formset %}
    -

    {{ inline_admin_formset.opts.verbose_name|capfirst }}: {% if inline_admin_form.original %}{{ inline_admin_form.original }}{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %} {% trans "Change" %}{% endif %} -{% else %}#{{ forloop.counter }}{% endif %} - {% if inline_admin_form.show_url %}{% trans "View on site" %}{% endif %} - {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}{% endif %} -

    - {% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %} - {% for fieldset in inline_admin_form %} - {% include "adminsortable2/includes/fieldset.html" %} - {% endfor %} - {% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %} - {{ inline_admin_form.fk_field.field }} -
    {% endfor %} -
    + {% for inline_admin_form in inline_admin_formset %}
    +

    {{ inline_admin_formset.opts.verbose_name|capfirst }}: {% if inline_admin_form.original %}{{ inline_admin_form.original }}{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %} {% trans "Change" %}{% endif %} + {% else %}#{{ forloop.counter }}{% endif %} + {% if inline_admin_form.show_url %}{% trans "View on site" %}{% endif %} + {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}{% endif %} +

    + {% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %} + {% for fieldset in inline_admin_form %} + {% include "adminsortable2/includes/fieldset.html" %} + {% endfor %} + {% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %} + {{ inline_admin_form.fk_field.field }} +
    {% endfor %} +
    diff --git a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/tabular.html b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/tabular.html index fa990c8..96af43c 100644 --- a/eo_gestion/vendor/adminsortable2/templates/adminsortable2/tabular.html +++ b/eo_gestion/vendor/adminsortable2/templates/adminsortable2/tabular.html @@ -1,82 +1,82 @@ {% load i18n admin_urls static admin_modify %}
    diff --git a/tests/settings.py b/tests/settings.py index 60e2178..c286700 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -20,7 +20,7 @@ ALLOWED_HOSTS = ['localhost'] DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'barbacompta', } }