anbar permission
This commit is contained in:
1 parent
489fda27d3
commit
8d5665a1dc
4 files changed
+15
No files matched your search
@@ -1191,6 +1191,9 @@ def operation(request):
|
||||
if request.method != 'POST':
|
||||
return HttpResponseBadRequest("متد ارسالی نامعتبر است.")
|
||||
|
||||
user_op = request.user
|
||||
user_store_room = get_object_or_404(StoreRoom, owners=user_op)
|
||||
|
||||
# استفاده از توابع امن اختصاصی پروژه برای جداسازی مقادیر عددی
|
||||
prd_id = _safe_int(request.POST.get('prd_id'))
|
||||
action_type = request.POST.get('actionType', '')
|
||||
@@ -1234,6 +1237,9 @@ def operation(request):
|
||||
# بخش دوم: ورود و خروج دستی (کنترل مستقیم با Transaction و Lock)
|
||||
# =====================================================================
|
||||
elif action_type in ['vorod', 'khoroj']:
|
||||
user_s_room = get_object_or_404(StoreRoom, owners=user_op)
|
||||
if not user_op.is_superuser and s_room != user_s_room:
|
||||
return HttpResponse("شما دسترسی ورود / خروج به این انبار ندارید")
|
||||
with transaction.atomic():
|
||||
# ساخت کوئری پایه برای دریافت تراکنشهای سال جاری کالا
|
||||
qs = ProductInStore.objects.filter(
|
||||
|
||||
Reference in new issue
Block a user