class KanbanColor(models.Model):
_inherit = 'crm.lead'
def update_kanban_color(self):
curr_time = datetime.datetime.now()
scheduler_line_obj = self.env['crm.lead']
scheduler_line_ids = self.env['crm.lead'].search([])
for scheduler_line_id in scheduler_line_ids:
scheduler_line = scheduler_line_obj.browse(scheduler_line_id)
last_update = scheduler_line.__last_update
_logger.info(last_update)
scheduler_line_obj.write(scheduler_line_id, {'color': 1})
ValueError: <class 'AttributeError'>: "'crm.lead' object has no attribute '_KanbanColor__last_update'" while evaluating
'model.update_kanban_color()'
What i do wrong?
And how to access __last_update field?
신고된 질문입니다
1
회신
6800
화면
Hello,
Instead of __last_update use write_date
| 관련 게시물 | 답글 | 화면 | 활동 | |
|---|---|---|---|---|
|
|
0
2월 25
|
3973 | ||
|
|
0
1월 25
|
3253 | ||
|
Field service upgrade
해결 완료
|
|
1
12월 24
|
3887 | |
|
|
1
6월 22
|
8254 | ||
|
|
2
5월 15
|
6357 |