diff --git a/.DS_Store b/.DS_Store index 8e9c863a..c218e44b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/osinaweb/.DS_Store b/osinaweb/.DS_Store index 13864498..6046a9c2 100644 Binary files a/osinaweb/.DS_Store and b/osinaweb/.DS_Store differ diff --git a/osinaweb/billing/.DS_Store b/osinaweb/billing/.DS_Store index 7820bbd8..976061f8 100644 Binary files a/osinaweb/billing/.DS_Store and b/osinaweb/billing/.DS_Store differ diff --git a/osinaweb/billing/templates/.DS_Store b/osinaweb/billing/templates/.DS_Store index e4ea3e2d..c35c3294 100644 Binary files a/osinaweb/billing/templates/.DS_Store and b/osinaweb/billing/templates/.DS_Store differ diff --git a/osinaweb/customercore/__pycache__/models.cpython-310.pyc b/osinaweb/customercore/__pycache__/models.cpython-310.pyc index ce0a31b3..f1d43aa2 100644 Binary files a/osinaweb/customercore/__pycache__/models.cpython-310.pyc and b/osinaweb/customercore/__pycache__/models.cpython-310.pyc differ diff --git a/osinaweb/customercore/__pycache__/urls.cpython-310.pyc b/osinaweb/customercore/__pycache__/urls.cpython-310.pyc index b2f26536..99c61b99 100644 Binary files a/osinaweb/customercore/__pycache__/urls.cpython-310.pyc and b/osinaweb/customercore/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index 014ffd42..54f3eb79 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-310.pyc and b/osinaweb/customercore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/add/__pycache__/urls.cpython-310.pyc b/osinaweb/customercore/add/__pycache__/urls.cpython-310.pyc new file mode 100644 index 00000000..fc324b5c Binary files /dev/null and b/osinaweb/customercore/add/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/customercore/add/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/add/__pycache__/views.cpython-310.pyc new file mode 100644 index 00000000..52f42671 Binary files /dev/null and b/osinaweb/customercore/add/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/migrations/__pycache__/0017_tickettask.cpython-310.pyc b/osinaweb/customercore/migrations/__pycache__/0017_tickettask.cpython-310.pyc new file mode 100644 index 00000000..0e065b86 Binary files /dev/null and b/osinaweb/customercore/migrations/__pycache__/0017_tickettask.cpython-310.pyc differ diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index a830643d..186c4f04 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/.DS_Store b/osinaweb/osinacore/.DS_Store index fd9444fd..bbd6ffd4 100644 Binary files a/osinaweb/osinacore/.DS_Store and b/osinaweb/osinacore/.DS_Store differ diff --git a/osinaweb/osinacore/__pycache__/urls.cpython-310.pyc b/osinaweb/osinacore/__pycache__/urls.cpython-310.pyc index 6e752e08..227f3eef 100644 Binary files a/osinaweb/osinacore/__pycache__/urls.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index 3e781aa1..9d6a2954 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc index a3f7b407..05b1dbc1 100644 Binary files a/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/add/views.py b/osinaweb/osinacore/add/views.py index a16ecafb..85217ba0 100644 --- a/osinaweb/osinacore/add/views.py +++ b/osinaweb/osinacore/add/views.py @@ -659,22 +659,30 @@ def add_ticket(request, customer_id): customer_orders_completed = customer_orders_with_last_status.filter(orderstatus__status='Completed', orderstatus__date=F('max_status_date')) customer_products = OrderItem.objects.filter(active__in=[True, None], item__type='Product', order__customer=customer, order__in=customer_orders_completed) customer_projects = Project.objects.filter(customer=customer) - departments = Department.objects.all().order_by('name') + all_departments = Department.objects.all().order_by('name') + + support_department = get_object_or_404(Department, name='Support') if request.method == 'POST': project = None product = None - department_ids = request.POST.getlist('departments') # Changed to get a list of department IDs - selected_departments = Department.objects.filter(id__in=department_ids) regarding = 'General/Account/Billing' + departments = [support_department] if request.POST.get('project'): project = get_object_or_404(Project, id=request.POST.get('project')) regarding = 'Project/Product' + project_types = project.project_type.all() + departments = [project_type.department for project_type in project_types] elif request.POST.get('product'): product = get_object_or_404(Item, id=request.POST.get('product')) + departments = [product.item_type.department] regarding = 'Project/Product' + + if request.POST.getlist('departments'): + department_ids = request.POST.getlist('departments') + departments = Department.objects.filter(id__in=department_ids) ticket = Ticket( status='Open', @@ -689,7 +697,7 @@ def add_ticket(request, customer_id): ) ticket.save() - ticket.departments.set(selected_departments) # Assign multiple departments + ticket.departments.set(departments) ticket_status_update = TicketStatus( ticket=ticket, @@ -712,7 +720,7 @@ def add_ticket(request, customer_id): 'customer_products': customer_products, 'customer_projects': customer_projects, 'customer': customer, - 'departments': departments + 'all_departments': all_departments } return render(request, 'add_templates/add-ticket.html', context) diff --git a/osinaweb/osinacore/templates/.DS_Store b/osinaweb/osinacore/templates/.DS_Store index fa2cbac9..1bb6a328 100644 Binary files a/osinaweb/osinacore/templates/.DS_Store and b/osinaweb/osinacore/templates/.DS_Store differ diff --git a/osinaweb/osinacore/templates/add_templates/add-ticket.html b/osinaweb/osinacore/templates/add_templates/add-ticket.html index 59b1d49a..68287429 100644 --- a/osinaweb/osinacore/templates/add_templates/add-ticket.html +++ b/osinaweb/osinacore/templates/add_templates/add-ticket.html @@ -33,13 +33,10 @@ @@ -47,13 +44,10 @@ @@ -62,7 +56,7 @@