Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
6185 Widoki

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.


Awatar
Odrzuć
Autor Najlepsza odpowiedź

bump?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
cze 25
15328
3
kwi 25
5471
1
lis 24
1538
0
sie 24
1589
Compute Fields Rozwiązane
2
lip 24
2420