forked from DGNum/gestioCOF
Tous les `on_delete` étaient mis à PROTECT, ce qui faisait qu'on ne pouvait rien supprimer... On les met à CASCADE pour tous les modèles secondaires (`AccountNegative`, `CheckoutStatement`, `InventoryArticle`, `SupplierArticle`, `Order` et `OrderArticle`) et pour les inventaires créés à partir d'une commande. Pour les modèles qui demandent une validation, et pour les `Operation`s, on met à NULL le compte ou l'article associé (cela ne change pas le total d'une opération, qui est la partie importante à garder).
134 lines
4.3 KiB
Python
134 lines
4.3 KiB
Python
# Generated by Django 2.2 on 2019-05-23 13:20
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [("kfet", "0065_choices_promo")]
|
|
|
|
operations = [
|
|
migrations.RemoveField(model_name="checkouttransfer", name="from_checkout"),
|
|
migrations.RemoveField(model_name="checkouttransfer", name="to_checkout"),
|
|
migrations.AlterField(
|
|
model_name="accountnegative",
|
|
name="account",
|
|
field=models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="negative",
|
|
to="kfet.Account",
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="checkoutstatement",
|
|
name="checkout",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="statements",
|
|
to="kfet.Checkout",
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="inventory",
|
|
name="order",
|
|
field=models.OneToOneField(
|
|
blank=True,
|
|
default=None,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="inventory",
|
|
to="kfet.Order",
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="inventoryarticle",
|
|
name="article",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE, to="kfet.Article"
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="inventoryarticle",
|
|
name="inventory",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE, to="kfet.Inventory"
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="operation",
|
|
name="article",
|
|
field=models.ForeignKey(
|
|
blank=True,
|
|
default=None,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="operations",
|
|
to="kfet.Article",
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="operationgroup",
|
|
name="valid_by",
|
|
field=models.ForeignKey(
|
|
blank=True,
|
|
default=None,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to="kfet.Account",
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="order",
|
|
name="supplier",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="orders",
|
|
to="kfet.Supplier",
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="orderarticle",
|
|
name="article",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE, to="kfet.Article"
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="orderarticle",
|
|
name="order",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE, to="kfet.Order"
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="supplierarticle",
|
|
name="article",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE, to="kfet.Article"
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="supplierarticle",
|
|
name="supplier",
|
|
field=models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE, to="kfet.Supplier"
|
|
),
|
|
),
|
|
migrations.AlterField(
|
|
model_name="transfergroup",
|
|
name="valid_by",
|
|
field=models.ForeignKey(
|
|
blank=True,
|
|
default=None,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="+",
|
|
to="kfet.Account",
|
|
),
|
|
),
|
|
migrations.DeleteModel(name="ArticleRule"),
|
|
migrations.DeleteModel(name="CheckoutTransfer"),
|
|
]
|