Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6190 Lượt xem

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.


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Please refer this,

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


Muhammed Ali - iWesabe


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

bump?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 25
15347
3
thg 4 25
5487
1
thg 11 24
1545
0
thg 8 24
1592
Compute Fields Đã xử lý
2
thg 7 24
2452