Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
6508 Näkymät

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
Hylkää
Tekijä Paras vastaus

bump?

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
kesäk. 25
16014
3
huhtik. 25
6490
1
marrask. 24
2044
0
elok. 24
1912
2
heinäk. 24
7259