Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
6166 Vistas

Hi all,


I am trying to make a field in the model accoutn.invoice.report. 


This field is to supply me with an average age of overdue invoices. Now the filtering I want to take place in my report (using Dashboard Ninja), but the number needs to come from the dataset. 

I have defined a custom field 

x_average_age

As dependencies I have:

invoice_date_due

My compute is:

for record in self:
  record["x_average_age"] = (datetime.today() - datetime(record.invoice_date)).days/365

I have no idea why this would or wouldn't work. I hope someone can help.


Avatar
Descartar
Autor Mejor respuesta

bump?

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jun 25
15306
3
abr 25
5440
1
nov 24
1521
0
ago 24
1582
2
jul 24
2347