fix: evitando duplicado de productos en la importacion.

This commit is contained in:
2024-06-29 16:57:50 -05:00
parent 84c295e7de
commit 64a9b75ad7
6 changed files with 37 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ class ProductCategory(models.Model):
return self.name
class Product(models.Model):
name = models.CharField(max_length=100)
name = models.CharField(max_length=100, unique=True)
price = models.DecimalField(max_digits=9, decimal_places=2)
measuring_unit = models.CharField(
max_length=20,