This commit is contained in:
parent
b62fa2b3b5
commit
a93ca78c8a
|
@ -2,3 +2,5 @@
|
|||
25ef1599be197445f48680306846bbfb19590502
|
||||
# misc: apply double-quote-string-fixer (#79788)
|
||||
f1941a3ad8fd726321ce19b2e0ce22a2a5911a6c
|
||||
# apply new pre-commit hooks (#85632)
|
||||
42ad175c4b191655a907ccae03c817f631a4dcbb
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,28 +2,37 @@ Source: barbacompta
|
|||
Section: python
|
||||
Priority: optional
|
||||
Maintainer: Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
||||
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,
|
||||
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,
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -6,7 +6,6 @@ import eo_gestion.chorus.validators
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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):
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class Command(BaseCommand):
|
|||
|
||||
can_import_django_settings = True
|
||||
output_transaction = True
|
||||
requires_system_checks = True
|
||||
requires_system_checks = '__all__'
|
||||
args = '<csv_file> <csv_file>...'
|
||||
help = 'Charge les fichiers CSVs'
|
||||
HEADER = [
|
||||
|
|
|
@ -13,7 +13,7 @@ class Command(BaseCommand):
|
|||
|
||||
can_import_django_settings = True
|
||||
output_transaction = True
|
||||
requires_system_checks = True
|
||||
requires_system_checks = '__all__'
|
||||
args = '<csv_file> <csv_file>...'
|
||||
help = 'Charge le solde courant'
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class Command(BaseCommand):
|
|||
|
||||
can_import_django_settings = True
|
||||
output_transaction = True
|
||||
requires_system_checks = True
|
||||
requires_system_checks = '__all__'
|
||||
args = '<csv_file> <csv_file>...'
|
||||
help = 'Charge le solde courant'
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_banque', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -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(
|
||||
'<path:object_id>/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('<a href="{0}">{1}</a>', 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('<a href="{0}">{1}</a>', url, obj.contrat)
|
||||
return format_html('Pas de contrat<br />{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(?P<year>20[0-9]{2})(?P<ordre>[0-9]{4})$')
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -19,7 +19,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0002_facture_account_on_previous_period'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0003_client_picture'),
|
||||
]
|
||||
|
|
|
@ -19,7 +19,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0004_contrat_public_description'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0005_contrat_image'),
|
||||
]
|
||||
|
|
|
@ -21,7 +21,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0006_client_contacts'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ import eo_gestion.eo_facture.validators
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0007_auto_20191009_1335'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('chorus', '__first__'),
|
||||
('eo_facture', '0008_auto_20200201_1559'),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0009_client_chorus_structure'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0010_auto_20200316_1616'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0011_contrat_url'),
|
||||
]
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0013_contrat_tags'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0014_facture_annulation'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0015_add_fields_for_periodic_invoicing'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0016_auto_20220518_1824'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0017_auto_20220518_1827'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0018_client_notes_privees'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0019_alter_contrat_client'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ import eo_gestion.eo_facture.models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0021_migrate_data_to_accounting_year'),
|
||||
]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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):
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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'):
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -20,7 +20,7 @@ ALLOWED_HOSTS = ['localhost']
|
|||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'barbacompta',
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue