Feat: Se agrega modelo de terceros closed #15
This commit is contained in:
@@ -5,6 +5,11 @@ from django.core.exceptions import ValidationError
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
class Customer(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
address = models.CharField(max_length=100)
|
||||
|
||||
|
||||
class MeasuringUnits(models.TextChoices):
|
||||
UNIT = 'UNIT', _('Unit')
|
||||
|
||||
@@ -31,8 +36,7 @@ class Product(models.Model):
|
||||
|
||||
|
||||
class Sale(models.Model):
|
||||
|
||||
customer = models.CharField(max_length=100)
|
||||
customer = models.ForeignKey(Customer, on_delete=models.PROTECT)
|
||||
date = models.DateField("Date")
|
||||
phone = models.CharField(max_length=13, null=True, blank=True)
|
||||
description = models.CharField(max_length=255, null=True, blank=True)
|
||||
|
||||
Reference in New Issue
Block a user