Skip to content

Commit

Permalink
fix(migrations): reset migrations and also add permissions to the model
Browse files Browse the repository at this point in the history
  • Loading branch information
sepehr-akbarzadeh committed Oct 18, 2024
1 parent 5acc08c commit ca0e56a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sage_invoice/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -433,7 +439,7 @@ class Migration(migrations.Migration):
),
),
(
"contacts",
"contact",
django_jsonform.models.fields.JSONField(
blank=True, null=True, verbose_name="Customer Contacts"
),
Expand Down
6 changes: 6 additions & 0 deletions sage_invoice/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ca0e56a

Please sign in to comment.