Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
6183 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

bump?

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvn 25
15325
3
dub 25
5467
1
lis 24
1535
0
srp 24
1585
Compute Fields Vyřešeno
2
čvc 24
2411