diff --git a/oscar_invoices/abstract_models.py b/oscar_invoices/abstract_models.py index 11582cd..1d82109 100644 --- a/oscar_invoices/abstract_models.py +++ b/oscar_invoices/abstract_models.py @@ -71,7 +71,7 @@ class AbstractInvoice(models.Model): verbose_name=_('Legal Entity')) number = models.CharField( - _('Invoice number'), max_length=128) + _('Invoice number'), max_length=128, unique=True) order = models.OneToOneField( 'order.Order', verbose_name=_('Order'), related_name='invoice', diff --git a/oscar_invoices/migrations/0003_auto_20190403_1910.py b/oscar_invoices/migrations/0003_auto_20190403_1910.py new file mode 100644 index 0000000..0021e50 --- /dev/null +++ b/oscar_invoices/migrations/0003_auto_20190403_1910.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.8 on 2019-04-03 19:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('oscar_invoices', '0002_auto_20180822_1335'), + ] + + operations = [ + migrations.AlterField( + model_name='invoice', + name='number', + field=models.CharField(max_length=128, unique=True, verbose_name='Invoice number'), + ), + ]