Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
6216 Tampilan

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
Buang
Penulis Jawaban Terbai

bump?

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jun 25
15362
3
Apr 25
5531
1
Nov 24
1586
0
Agu 24
1605
Compute Fields Diselesaikan
2
Jul 24
2523