Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
6189 มุมมอง

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.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please refer this,

https://www.odoo.com/documentation/13.0/reference/orm.html#module-odoo.api


Muhammed Ali - iWesabe


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

bump?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มิ.ย. 25
15347
3
เม.ย. 25
5486
1
พ.ย. 24
1545
0
ส.ค. 24
1592
Compute Fields แก้ไขแล้ว
2
ก.ค. 24
2451