@ 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:
- CRM
- e-Commerce
- Contabilitate
- Inventar
- PoS
- Project
- MRP
Această întrebare a fost marcată
Hi,
Please try his code
from odoo.fields import Date |
Hope it helps
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Înscrie-teRelated Posts | Răspunsuri | Vizualizări | Activitate | |
---|---|---|---|---|
|
1
nov. 24
|
1173 | ||
|
1
apr. 23
|
2519 | ||
|
7
feb. 23
|
9021 | ||
|
0
sept. 22
|
1689 | ||
|
1
iul. 22
|
1412 |