2016-07-21 23:19:50 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2024-06-24 11:07:36 +00:00
|
|
|
import django.db.models.deletion
|
|
|
|
from django.conf import settings
|
2016-07-21 23:19:50 +00:00
|
|
|
from django.db import migrations, models
|
2024-06-24 11:07:36 +00:00
|
|
|
|
2016-07-21 23:19:50 +00:00
|
|
|
import accounting.models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
2018-10-04 19:29:19 +00:00
|
|
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
2016-07-21 23:19:50 +00:00
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="Basket",
|
2016-07-21 23:19:50 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("date", models.DateTimeField(verbose_name="date", auto_now=True)),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
verbose_name="user",
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
related_name="baskets",
|
|
|
|
),
|
|
|
|
),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="BasketItem",
|
2016-07-21 23:19:50 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("product_id", models.IntegerField(verbose_name="product id")),
|
|
|
|
(
|
|
|
|
"product_name",
|
|
|
|
models.CharField(max_length=255, verbose_name="product name"),
|
|
|
|
),
|
|
|
|
("type_id", models.IntegerField(verbose_name="product type id")),
|
|
|
|
(
|
|
|
|
"product_unit_price",
|
|
|
|
accounting.models.CurrencyField(
|
|
|
|
decimal_places=2, max_digits=12, verbose_name="unit price"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("quantity", models.IntegerField(verbose_name="quantity")),
|
|
|
|
(
|
|
|
|
"basket",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
verbose_name="basket",
|
|
|
|
to="eboutic.Basket",
|
|
|
|
related_name="items",
|
2018-10-04 19:29:19 +00:00
|
|
|
),
|
|
|
|
),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
2018-10-04 19:29:19 +00:00
|
|
|
options={"abstract": False},
|
2016-07-21 23:19:50 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="Invoice",
|
2016-07-21 23:19:50 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("date", models.DateTimeField(verbose_name="date", auto_now=True)),
|
|
|
|
(
|
|
|
|
"validated",
|
|
|
|
models.BooleanField(verbose_name="validated", default=False),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
verbose_name="user",
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
related_name="invoices",
|
|
|
|
),
|
|
|
|
),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="InvoiceItem",
|
2016-07-21 23:19:50 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("product_id", models.IntegerField(verbose_name="product id")),
|
|
|
|
(
|
|
|
|
"product_name",
|
|
|
|
models.CharField(max_length=255, verbose_name="product name"),
|
|
|
|
),
|
|
|
|
("type_id", models.IntegerField(verbose_name="product type id")),
|
|
|
|
(
|
|
|
|
"product_unit_price",
|
|
|
|
accounting.models.CurrencyField(
|
|
|
|
decimal_places=2, max_digits=12, verbose_name="unit price"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("quantity", models.IntegerField(verbose_name="quantity")),
|
|
|
|
(
|
|
|
|
"invoice",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
verbose_name="invoice",
|
|
|
|
to="eboutic.Invoice",
|
|
|
|
related_name="items",
|
|
|
|
),
|
|
|
|
),
|
2016-07-21 23:19:50 +00:00
|
|
|
],
|
2018-10-04 19:29:19 +00:00
|
|
|
options={"abstract": False},
|
2016-07-21 23:19:50 +00:00
|
|
|
),
|
|
|
|
]
|