From ca0e56a61a3cc9c9e4c1c0d2559ff475ac2fff26 Mon Sep 17 00:00:00 2001 From: Sepehr Akbarzadeh Date: Fri, 18 Oct 2024 03:47:03 +0330 Subject: [PATCH] fix(migrations): reset migrations and also add permissions to the model --- sage_invoice/migrations/0001_initial.py | 10 ++++++++-- sage_invoice/models/invoice.py | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sage_invoice/migrations/0001_initial.py b/sage_invoice/migrations/0001_initial.py index c0006f6..a646e03 100644 --- a/sage_invoice/migrations/0001_initial.py +++ b/sage_invoice/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1.2 on 2024-10-18 00:01 +# Generated by Django 5.1.2 on 2024-10-18 00:16 import django.db.models.deletion import django_jsonform.models.fields @@ -260,6 +260,12 @@ class Migration(migrations.Migration): "verbose_name": "Invoice", "verbose_name_plural": "Invoices", "db_table": "sage_invoice", + "permissions": [ + ("mark_as_paid", "Grants mark invoices as paid"), + ("mark_as_unpaid", "Grants Can mark invoices as unpaid"), + ("apply_discount", "Grants apply discounts to invoices"), + ("reject_invoice", "Grants reject invoices"), + ], }, ), migrations.CreateModel( @@ -433,7 +439,7 @@ class Migration(migrations.Migration): ), ), ( - "contacts", + "contact", django_jsonform.models.fields.JSONField( blank=True, null=True, verbose_name="Customer Contacts" ), diff --git a/sage_invoice/models/invoice.py b/sage_invoice/models/invoice.py index 086b983..f94dacc 100644 --- a/sage_invoice/models/invoice.py +++ b/sage_invoice/models/invoice.py @@ -140,6 +140,12 @@ def get_absolute_url(self): class Meta: verbose_name = _("Invoice") verbose_name_plural = _("Invoices") + permissions = [ + ("mark_as_paid", _("Grants mark invoices as paid")), + ("mark_as_unpaid", _("Grants Can mark invoices as unpaid")), + ("apply_discount", _("Grants apply discounts to invoices")), + ("reject_invoice", _("Grants reject invoices")), + ] db_table = "sage_invoice" def __str__(self):