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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
1
回覆
5126
瀏覽次數
Hello,
Instead of __last_update use write_date
相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
---|---|---|---|---|
|
0
2月 25
|
1490 | ||
|
0
1月 25
|
1250 | ||
|
1
12月 24
|
1658 | ||
|
1
6月 22
|
5860 | ||
|
2
5月 15
|
4365 |