fix - change broker price to boolean & order transaction by modify date
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.0 on 2025-11-09 11:38
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0082_broker_fix_broker_price_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='broker',
|
||||
name='fix_broker_price_state',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0 on 2025-11-09 11:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0083_remove_broker_fix_broker_price_state'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='broker',
|
||||
name='fix_broker_price_state',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
||||
@@ -1,19 +1,18 @@
|
||||
from apps.warehouse.pos.api.v1 import serializers as warehouse_serializers
|
||||
from apps.warehouse.services.services import (
|
||||
can_buy_from_inventory,
|
||||
rancher_quota_weight,
|
||||
get_rancher_statistics
|
||||
)
|
||||
from apps.pos_device.mixins.pos_device_mixin import POSDeviceMixin
|
||||
from apps.core.mixins.search_mixin import DynamicSearchMixin
|
||||
from apps.warehouse import models as warehouse_models
|
||||
from django.db import transaction
|
||||
from rest_framework import status
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.permissions import AllowAny
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework import viewsets
|
||||
|
||||
from apps.core.mixins.search_mixin import DynamicSearchMixin
|
||||
from apps.herd.models import Rancher
|
||||
from rest_framework import status
|
||||
from django.db import transaction
|
||||
from apps.pos_device.mixins.pos_device_mixin import POSDeviceMixin
|
||||
from apps.warehouse import models as warehouse_models
|
||||
from apps.warehouse.pos.api.v1 import serializers as warehouse_serializers
|
||||
from apps.warehouse.services.services import (
|
||||
can_buy_from_inventory
|
||||
)
|
||||
|
||||
|
||||
class InventoryEntryViewSet(viewsets.ModelViewSet, DynamicSearchMixin, POSDeviceMixin):
|
||||
@@ -113,7 +112,7 @@ class InventoryQuotaSaleTransactionViewSet(viewsets.ModelViewSet, DynamicSearchM
|
||||
# get device object
|
||||
device = self.get_pos_device()
|
||||
|
||||
queryset = self.queryset.filter(pos_device=device)
|
||||
queryset = self.queryset.filter(pos_device=device).order_by('-modify_date')
|
||||
queryset = self.filter_query(queryset)
|
||||
|
||||
# paginate & response
|
||||
|
||||
Reference in New Issue
Block a user