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:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
1
Répondre
4879
Vues
Hello,
Instead of __last_update use write_date
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
0
févr. 25
|
1206 | ||
|
0
janv. 25
|
1027 | ||
Field service upgrade
Résolu
|
|
1
déc. 24
|
1330 | |
|
1
juin 22
|
5349 | ||
|
2
mai 15
|
4150 |