7777DEAL_CO_OWNER_NOTICE = _ ("You are the co-owner of the deal" )
7878LEAD_ATTR_LIST = CONTACT_ATTR_LIST + ('country' , 'company_name' )
7979table_loyalty_icon = '<i title="{}" class="material-icons" ' \
80- 'style="color: var(--body-quiet-color)">loyalty</i>' .format (client_loyalty_title )
80+ 'style="color: var(--body-quiet-color)">loyalty</i>' .format (
81+ client_loyalty_title )
8182loyalty_icon = '<i title="{}" class="material-icons" style="font-size: 17px;color: var(--green-fg)">loyalty</i>'
8283primary_icon = '<i title="{}" class="material-icons" style="font-size: 17px;color: #ECBA82">local_offer</i>'
8384primary_title = _ ("Primary request" )
@@ -104,7 +105,6 @@ class RequestAdmin(CrmModelAdmin):
104105 'fields' : [
105106 'request_for' ,
106107 'duplicate' ,
107- 'case' ,
108108 ('lead_source' , 'receipt_date' ),
109109 ('department' , 'owner' , 'co_owner' ),
110110 ('first_name' , 'middle_name' , 'last_name' ),
@@ -219,7 +219,8 @@ def get_list_display(self, request):
219219 if not any (('company' in request .GET , 'lead' in request .GET )):
220220 list_display .append ('request_counter' )
221221 list_display .extend (('the_full_name' , 'the_receipt_date' ))
222- if not (request .user .is_manager and 'owner' not in request .GET ):
222+ if not (request .user .is_manager and 'owner' not in request .GET ) \
223+ or request .user .is_chief :
223224 list_display .append ('person' )
224225 list_display .append ('status' )
225226 list_display .append ('content_copy' )
@@ -291,7 +292,7 @@ def save_model(self, request, obj, form, change):
291292 super ().save_model (request , obj , form , change )
292293
293294 if not obj .products .exists ():
294- messages .warning (request , _ ("Specify products" ))
295+ messages .warning (request , _ ("Specify products" ))
295296
296297 def save_related (self , request , form , formsets , change ):
297298 super ().save_related (request , form , formsets , change )
@@ -355,7 +356,7 @@ def counterparty(self, obj):
355356 url = counterparty .get_crm_url ()
356357 return mark_safe (
357358 f'<a href="{ url } ">{ counterparty .full_name } </a>'
358- )
359+ )
359360 return obj .company_name
360361
361362 @staticmethod
@@ -400,7 +401,8 @@ def request_counter(obj):
400401 return mark_safe (link )
401402 elif counter == 1 :
402403 return mark_safe (f'<span title="{ obj_plural_name } ">(1)</span>' )
403- return mark_safe (' ' ) # to avoid showing dashes if there is no counter
404+ # to avoid showing dashes if there is no counter
405+ return mark_safe (' ' )
404406
405407 @admin .display (
406408 description = subject_safe_icon ,
@@ -414,11 +416,6 @@ def request_subject(self, obj):
414416 return mark_safe (
415417 f'<span style="color: var(--body-quiet-color)">({ duplicate } ) { obj .request_for } </span>'
416418 )
417- if obj .case :
418- case = obj ._meta .get_field ('case' ).verbose_name
419- return mark_safe (
420- f'<span style="color: var(--body-quiet-color)">({ case } ) { obj .request_for } </span>'
421- )
422419 return obj .request_for
423420
424421 @admin .display (description = status_str )
0 commit comments