コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
6176 ビュー

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.


アバター
破棄
著作者 最善の回答

bump?

アバター
破棄
関連投稿 返信 ビュー 活動
1
6月 25
15311
3
4月 25
5447
1
11月 24
1533
0
8月 24
1583
2
7月 24
2364