2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 04:56:45 +00:00
InvenTree/InvenTree/order/migrations/0064_auto_20220329_2246.py
Matthias aa30e62ad8
[BUG] Deleting a Customer Breaks Associated Sales Orders
Add special protected deleted company
Fixes #2788
2022-03-30 01:29:36 +02:00

26 lines
1.1 KiB
Python

# Generated by Django 3.2.12 on 2022-03-29 22:46
from django.db import migrations, models
import order.models
class Migration(migrations.Migration):
dependencies = [
('company', '0043_company_is_deleted'),
('order', '0063_alter_purchaseorderlineitem_unique_together'),
]
operations = [
migrations.AlterField(
model_name='purchaseorder',
name='supplier',
field=models.ForeignKey(help_text='Company from which the items are being ordered', limit_choices_to={'is_supplier': True}, on_delete=models.SET(order.models.get_deleted_company), related_name='purchase_orders', to='company.company', verbose_name='Supplier'),
),
migrations.AlterField(
model_name='salesorder',
name='customer',
field=models.ForeignKey(help_text='Company to which the items are being sold', limit_choices_to={'is_customer': True}, null=True, on_delete=models.SET(order.models.get_deleted_company), related_name='sales_orders', to='company.company', verbose_name='Customer'),
),
]