Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
6174 Переглядів

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
15309
3
квіт. 25
5444
1
лист. 24
1533
0
серп. 24
1583
Compute Fields Вирішено
2
лип. 24
2360