new release
This commit is contained in:
parent
7863cba33c
commit
1f14e4651b
4 changed files with 27 additions and 7 deletions
|
|
@ -25,7 +25,7 @@ from contacts.serializer import ContactSerializer
|
|||
from tasks.serializer import TaskSerializer
|
||||
from opportunity.serializer import OpportunitySerializer
|
||||
from invoices.serializer import InvoiceSerailizer
|
||||
from accounts.serializer import EmailSerializer
|
||||
from accounts.serializer import EmailSerializer,TagsSerailizer
|
||||
from teams.models import Teams
|
||||
|
||||
from rest_framework import status
|
||||
|
|
@ -113,6 +113,12 @@ class AccountsListView(APIView, LimitOffsetPagination):
|
|||
"close_accounts": accounts_close,
|
||||
}
|
||||
context["industries"] = INDCHOICES
|
||||
|
||||
tags = Tags.objects.all()
|
||||
tags=TagsSerailizer(tags,many=True).data
|
||||
|
||||
context['tags']=tags
|
||||
|
||||
return context
|
||||
|
||||
@swagger_auto_schema(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from rest_framework import status
|
||||
from common.models import Attachments, Comment
|
||||
from common.models import Attachments, Comment, Profile
|
||||
from contacts.models import Contact, Profile
|
||||
from teams.models import Teams
|
||||
from django.db.models import Q
|
||||
|
|
@ -41,6 +41,7 @@ class ContactsListView(APIView, LimitOffsetPagination):
|
|||
Q(assigned_to__in=[self.request.profile]) | Q(
|
||||
created_by=self.request.profile)
|
||||
).distinct()
|
||||
|
||||
if params:
|
||||
if params.get("name"):
|
||||
queryset = queryset.filter(
|
||||
|
|
@ -81,6 +82,12 @@ class ContactsListView(APIView, LimitOffsetPagination):
|
|||
context["contact_obj_list"] = contacts
|
||||
context["countries"] = COUNTRIES
|
||||
context["per_page"] = params.get("per_page")
|
||||
users = Profile.objects.filter(is_active=True, org=self.request.org).values(
|
||||
"id",
|
||||
"user__email"
|
||||
)
|
||||
context["users"]=users
|
||||
|
||||
return context
|
||||
|
||||
@swagger_auto_schema(
|
||||
|
|
@ -93,6 +100,7 @@ class ContactsListView(APIView, LimitOffsetPagination):
|
|||
@swagger_auto_schema(
|
||||
tags=["contacts"], manual_parameters=swagger_params.contact_create_post_params
|
||||
)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
params = request.query_params if len(
|
||||
request.data) == 0 else request.data
|
||||
|
|
@ -192,6 +200,7 @@ class ContactDetailView(APIView):
|
|||
data,
|
||||
status=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
|
||||
|
||||
if contact_serializer.is_valid():
|
||||
if self.request.profile.role != "ADMIN" and not self.request.profile.is_admin:
|
||||
|
|
@ -412,7 +421,6 @@ class ContactDetailView(APIView):
|
|||
)
|
||||
return Response(context)
|
||||
|
||||
|
||||
class ContactCommentView(APIView):
|
||||
model = Comment
|
||||
authentication_classes = (JSONWebTokenAuthentication,)
|
||||
|
|
@ -473,7 +481,6 @@ class ContactCommentView(APIView):
|
|||
status=status.HTTP_403_FORBIDDEN,
|
||||
)
|
||||
|
||||
|
||||
class ContactAttachmentView(APIView):
|
||||
model = Attachments
|
||||
authentication_classes = (JSONWebTokenAuthentication,)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from common.serializer import (
|
|||
)
|
||||
from leads.models import Lead, Company
|
||||
from leads.forms import LeadListForm
|
||||
from leads.serializer import LeadSerializer, LeadCreateSerializer, CompanySerializer
|
||||
from leads.serializer import LeadSerializer, LeadCreateSerializer, CompanySerializer, TagsSerializer
|
||||
from leads.tasks import (
|
||||
create_lead_from_file,
|
||||
send_email_to_assigned_user,
|
||||
|
|
@ -123,7 +123,6 @@ class LeadListView(APIView, LimitOffsetPagination):
|
|||
"close_leads": close_leads,
|
||||
"offset": offset
|
||||
}
|
||||
|
||||
contacts = Contact.objects.filter(org=self.request.org).values(
|
||||
"id",
|
||||
"first_name"
|
||||
|
|
@ -133,6 +132,12 @@ class LeadListView(APIView, LimitOffsetPagination):
|
|||
context["source"] = LEAD_SOURCE
|
||||
context["companies"] = CompanySerializer(
|
||||
Company.objects.filter(org=self.request.org), many=True).data
|
||||
context["tags"] = TagsSerializer(Tags.objects.all(),many=True).data
|
||||
|
||||
users = Profile.objects.filter(is_active=True, org=self.request.org).values(
|
||||
"id",
|
||||
"user__email")
|
||||
context["users"]=users
|
||||
context["countries"] = COUNTRIES
|
||||
context["industries"] = INDCHOICES
|
||||
return context
|
||||
|
|
@ -211,6 +216,7 @@ class LeadListView(APIView, LimitOffsetPagination):
|
|||
website=params.get("website"),
|
||||
org=request.org
|
||||
)
|
||||
|
||||
account_object.billing_address_line = lead_obj.address_line
|
||||
account_object.billing_street = lead_obj.street
|
||||
account_object.billing_city = lead_obj.city
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from opportunity.serializer import (
|
|||
OpportunityCreateSerializer,
|
||||
)
|
||||
from accounts.models import Account, Tags
|
||||
from accounts.serializer import AccountSerializer
|
||||
from accounts.serializer import AccountSerializer, TagsSerailizer
|
||||
from common.models import Attachments, Comment, Profile
|
||||
from common.custom_auth import JSONWebTokenAuthentication
|
||||
from common.serializer import (
|
||||
|
|
@ -101,6 +101,7 @@ class OpportunityListView(APIView, LimitOffsetPagination):
|
|||
context["opportunities"] = opportunities
|
||||
context["accounts_list"] = AccountSerializer(accounts, many=True).data
|
||||
context["contacts_list"] = ContactSerializer(contacts, many=True).data
|
||||
context['tags'] = TagsSerailizer(Tags.objects.filter(),many=True).data
|
||||
context["stage"] = STAGES
|
||||
context["lead_source"] = SOURCES
|
||||
context["currency"] = CURRENCY_CODES
|
||||
|
|
|
|||
Loading…
Reference in a new issue