Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4995 Widoki
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?
Awatar
Odrzuć
Najlepsza odpowiedź

Hello,

Instead of __last_update   use  write_date

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lut 25
1334
0
sty 25
1149
1
gru 24
1498
1
cze 22
5639
2
maj 15
4289