@ 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
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
Hi,
Please try his code
from odoo.fields import Date |
Hope it helps
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
1
nov 24
|
1174 | ||
|
1
apr 23
|
2529 | ||
|
7
feb 23
|
9028 | ||
|
0
set 22
|
1693 | ||
|
1
lug 22
|
1412 |