@ api.onchange ( 'duration' )def compute_status ( self ):
if self .duration! = 0 :
for record in self .subscription:
record.write ({ 'subscription_months_calc' : record.duration + record.subscription_months_calc})
record. write ({ 'subscription_expiry_date' : record.subscription_registration_date + relativedelta (
months = record.subscription_months_calc)})
I have wrote the above function to make change into my another custom module. It is not changing the value nor it is giving an error. Kindly help me.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
Hi,
Please try his code
from odoo.fields import Date |
Hope it helps
相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
---|---|---|---|---|
|
1
11月 24
|
1202 | ||
|
1
4月 23
|
2569 | ||
|
7
2月 23
|
9090 | ||
|
0
9月 22
|
1708 | ||
|
1
7月 22
|
1454 |