From 2694bea5af56d18e7127e61626a34f77361cb907 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Sat, 6 Sep 2025 14:49:45 +0500 Subject: [PATCH] fix --- .../migrations/0008_alter_product_code.py | 18 ++++++++++++++++++ core/apps/products/models/product.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 core/apps/products/migrations/0008_alter_product_code.py diff --git a/core/apps/products/migrations/0008_alter_product_code.py b/core/apps/products/migrations/0008_alter_product_code.py new file mode 100644 index 0000000..80635b6 --- /dev/null +++ b/core/apps/products/migrations/0008_alter_product_code.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2 on 2025-09-06 14:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0007_product_quantity_left'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='code', + field=models.CharField(blank=True, max_length=200, null=True), + ), + ] diff --git a/core/apps/products/models/product.py b/core/apps/products/models/product.py index e81c919..a954ca9 100644 --- a/core/apps/products/models/product.py +++ b/core/apps/products/models/product.py @@ -24,7 +24,7 @@ class Product(BaseModel): unity = models.ForeignKey(Unity, on_delete=models.CASCADE, related_name='products', null=True) tg_id = models.CharField(max_length=50, null=True, blank=True) article = models.CharField(max_length=200, null=True, blank=True, unique=True) - code = models.CharField(max_length=200, unique=True, null=True, blank=True) + code = models.CharField(max_length=200, null=True, blank=True) quantity_left = models.PositiveBigIntegerField(default=0) def __str__(self):