fix
This commit is contained in:
@@ -71,7 +71,10 @@ class ExpenceCreateSerializer(serializers.ModelSerializer):
|
||||
expence.counterparty.total_debit += expence.price
|
||||
expence.counterparty.save()
|
||||
body = f"""{user.full_name} {expence.price} {expence.currency.upper()}... \n screen: /monitoring"""
|
||||
notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body)
|
||||
data = {
|
||||
"screen": "/monitoring"
|
||||
}
|
||||
notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body, data=data)
|
||||
cash_transaction.save()
|
||||
payment_type.save()
|
||||
return expence
|
||||
|
||||
@@ -2,7 +2,7 @@ from core.apps.notifications.models import Notification
|
||||
from core.apps.notifications.utils.send_notification import send_notification
|
||||
|
||||
|
||||
def notify_user(user, title, body):
|
||||
def notify_user(user, title, body, data):
|
||||
tokens = Notification.objects.filter(user=user)
|
||||
for token in tokens:
|
||||
send_notification(token.token, title, body)
|
||||
send_notification(token.token, title, body, data)
|
||||
@@ -85,9 +85,12 @@ class MultipleOrderCreateSerializer(serializers.Serializer):
|
||||
employee=self.context.get('user'),
|
||||
)
|
||||
orders.append(order)
|
||||
body = f"""{user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma yetkazish sanasi {common_date} \n screen: /supply
|
||||
body = f"""{user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma yetkazish sanasi {common_date}
|
||||
"""
|
||||
notify_user(user=user, title="Ta'minot",body=body)
|
||||
data = {
|
||||
"screen": "/supply"
|
||||
}
|
||||
notify_user(user=user, title="Ta'minot",body=body, data=data)
|
||||
|
||||
created_orders = Order.objects.bulk_create(orders)
|
||||
return created_orders
|
||||
|
||||
Reference in New Issue
Block a user