From da927754e0ce2b1b7c04d876d106b7579bd49ce4 Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Sun, 24 Jan 2021 11:07:19 +0100 Subject: [PATCH] fix: Permission DoesNotExist when accessing BaseInvoice history See the issue for details. Closes #317 . --- .../migrations/0003_auto_20210124_1105.py | 19 +++++++++++++++++++ cotisations/models.py | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 cotisations/migrations/0003_auto_20210124_1105.py diff --git a/cotisations/migrations/0003_auto_20210124_1105.py b/cotisations/migrations/0003_auto_20210124_1105.py new file mode 100644 index 00000000..63e7dec5 --- /dev/null +++ b/cotisations/migrations/0003_auto_20210124_1105.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2021-01-24 10:05 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('cotisations', '0002_foreign_keys'), + ] + + operations = [ + migrations.AlterModelOptions( + name='baseinvoice', + options={'permissions': (('view_baseinvoice', 'Can view an base invoice object'),)}, + ), + ] diff --git a/cotisations/models.py b/cotisations/models.py index 74be4285..759f5320 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -60,6 +60,12 @@ from cotisations.validators import check_no_balance class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): date = models.DateTimeField(auto_now_add=True, verbose_name=_("date")) + class Meta: + abstract = False + permissions = ( + ("view_baseinvoice", _("Can view an base invoice object")), + ) + # TODO : change prix to price def prix(self): """