Skip to Content
Menu
This question has been flagged
2 Replies
6231 Rodiniai

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.


Portretas
Atmesti
Autorius Best Answer

bump?

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
birž. 25
15387
3
bal. 25
5561
1
lapkr. 24
1599
0
rugp. 24
1615
2
liep. 24
2611