Подсветка ячейки Обзвон
Добавил подсветку ячейки обзвон при отсутсвии в ней данных и условии что прошло 10 дней со времени согласования
This commit is contained in:
@@ -101,6 +101,8 @@ class Order(models.Model):
|
|||||||
need_color=False
|
need_color=False
|
||||||
if self.approved!=None:
|
if self.approved!=None:
|
||||||
need_color = (date.today()-self.approved.date()>= timedelta(days = 10))
|
need_color = (date.today()-self.approved.date()>= timedelta(days = 10))
|
||||||
|
need_color = need_color and (self.calls == '')
|
||||||
|
|
||||||
return need_color
|
return need_color
|
||||||
|
|
||||||
#Эскизы
|
#Эскизы
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ class ColoredEditableColumn(EditableColumn):
|
|||||||
self.condition_field = condition_field
|
self.condition_field = condition_field
|
||||||
|
|
||||||
def render(self, record, **kwargs):
|
def render(self, record, **kwargs):
|
||||||
|
print eval('record.%s' % self.condition_field)
|
||||||
if self.condition_field != None and eval('record.%s' % self.condition_field):
|
if self.condition_field != None and eval('record.%s' % self.condition_field):
|
||||||
self.attrs = {'th': {'bgcolor': '#FFE4E1'}}
|
self.attrs = {'td': {'bgcolor': '#FFE4E1'}}
|
||||||
else:
|
else:
|
||||||
self.attrs = {}
|
self.attrs = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user