make customer name required field.
This commit is contained in:
@@ -6,8 +6,11 @@ from decimal import Decimal
|
||||
|
||||
|
||||
class Customer(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
address = models.CharField(max_length=100)
|
||||
name = models.CharField(max_length=100, default=None, null=False, blank=False)
|
||||
address = models.CharField(max_length=100, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class MeasuringUnits(models.TextChoices):
|
||||
@@ -53,7 +56,7 @@ class Sale(models.Model):
|
||||
class SaleLine(models.Model):
|
||||
|
||||
sale = models.ForeignKey(Sale, on_delete=models.CASCADE)
|
||||
product = models.ForeignKey(Product, on_delete=models.CASCADE)
|
||||
product = models.ForeignKey(Product, null=False, blank=False, on_delete=models.CASCADE)
|
||||
quantity = models.IntegerField(null=True)
|
||||
unit_price = models.DecimalField(max_digits=9, decimal_places=2)
|
||||
description = models.CharField(max_length=255, null=True, blank=True)
|
||||
|
||||
Reference in New Issue
Block a user