log login error
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 5.0 on 2025-09-14 06:02
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('warehouse', '0021_inventoryquotasaletransaction_weight'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='inventoryquotasaletransaction',
|
||||
name='inventory_entry',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='inventoryquotasaletransaction',
|
||||
name='quota_distribution',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 5.0 on 2025-09-14 07:13
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0072_alter_quota_base_price_cooperative_and_more'),
|
||||
('warehouse', '0022_remove_inventoryquotasaletransaction_inventory_entry_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='inventoryquotasaletransaction',
|
||||
name='inventory_entry',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inventory_sales', to='warehouse.inventoryentry'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='inventoryquotasaletransaction',
|
||||
name='quota_distribution',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inventory_sales', to='product.quotadistribution'),
|
||||
),
|
||||
]
|
||||
@@ -72,7 +72,7 @@ class InventoryEntryViewSet(viewsets.ModelViewSet, DynamicSearchMixin, POSDevice
|
||||
]
|
||||
|
||||
# paginate & response
|
||||
page = self.paginate_queryset(available_entries)
|
||||
page = self.paginate_queryset(available_entries) # noqa
|
||||
if page is not None:
|
||||
serializer = self.get_serializer(page, many=True, context={'rancher': rancher.first(), 'device': device})
|
||||
# set custom message for paginator
|
||||
|
||||
@@ -165,8 +165,6 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
representation['pos_device'] = DeviceSerializer(instance.pos_device).data
|
||||
if instance.seller_organization:
|
||||
representation['seller_organization'] = instance.seller_organization.name
|
||||
if instance.inventory_entry:
|
||||
representation['inventory_entry'] = InventoryEntrySerializer(instance.inventory_entry).data
|
||||
|
||||
return representation
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ def update_distribution_warehouse_entry(sender, instance, **kwargs):
|
||||
warehouse_sold_and_balance(instance.distribution)
|
||||
|
||||
|
||||
@receiver(post_save, sender=InventoryQuotaSaleTransaction)
|
||||
@receiver(post_delete, sender=InventoryQuotaSaleTransaction)
|
||||
def update_distribution_warehouse_sold_and_balance(sender, instance, **kwargs):
|
||||
if instance.quota_distribution:
|
||||
warehouse_sold_and_balance(instance.quota_distribution)
|
||||
else:
|
||||
print("quota distribution is null - warehouse app signals")
|
||||
# @receiver(post_save, sender=InventoryQuotaSaleTransaction)
|
||||
# @receiver(post_delete, sender=InventoryQuotaSaleTransaction)
|
||||
# def update_distribution_warehouse_sold_and_balance(sender, instance, **kwargs):
|
||||
# if instance.quota_distribution:
|
||||
# warehouse_sold_and_balance(instance.quota_distribution)
|
||||
# else:
|
||||
# print("quota distribution is null - warehouse app signals")
|
||||
|
||||
Reference in New Issue
Block a user