115 lines
3.8 KiB
Python
115 lines
3.8 KiB
Python
# Generated by Django 5.0.3 on 2024-05-12 23:18
|
|
|
|
import django.db.models.deletion
|
|
from decimal import Decimal
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("shop", "0002_remove_product_unit_order_status_product_images_and_more"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Provider",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"vat_id",
|
|
models.CharField(
|
|
max_length=32,
|
|
unique=True,
|
|
verbose_name="Documento de identidad",
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=64, verbose_name="Nombre")),
|
|
(
|
|
"email",
|
|
models.EmailField(
|
|
max_length=254, verbose_name="E-mail de contacto"
|
|
),
|
|
),
|
|
(
|
|
"phone",
|
|
models.CharField(
|
|
blank=True,
|
|
default="",
|
|
max_length=16,
|
|
null=True,
|
|
verbose_name="Teléfono de contacto",
|
|
),
|
|
),
|
|
("address", models.CharField(max_length=255, verbose_name="Dirección")),
|
|
("city", models.CharField(max_length=64, verbose_name="Ciudad")),
|
|
("state", models.CharField(max_length=64, verbose_name="Región")),
|
|
("country", models.CharField(max_length=64, verbose_name="País")),
|
|
("zip", models.CharField(max_length=32, verbose_name="Código postal")),
|
|
],
|
|
options={
|
|
"verbose_name": "Proveedor",
|
|
"verbose_name_plural": "Proveedores",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="ProductBatch",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"code",
|
|
models.CharField(
|
|
db_index=True, max_length=32, unique=True, verbose_name="Código"
|
|
),
|
|
),
|
|
(
|
|
"quantity",
|
|
models.DecimalField(
|
|
decimal_places=4,
|
|
default=Decimal("1"),
|
|
max_digits=13,
|
|
verbose_name="Cantidad",
|
|
),
|
|
),
|
|
(
|
|
"creation_date",
|
|
models.DateTimeField(
|
|
auto_now_add=True, verbose_name="Fecha de creación"
|
|
),
|
|
),
|
|
(
|
|
"expiration_date",
|
|
models.DateField(
|
|
blank=True,
|
|
null=True,
|
|
verbose_name="Fecha de caducidad / consumo preferente",
|
|
),
|
|
),
|
|
(
|
|
"product",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
to="shop.product",
|
|
verbose_name="Producto",
|
|
),
|
|
),
|
|
],
|
|
),
|
|
]
|