@ 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
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
Hi,
Please try his code
from odoo.fields import Date |
Hope it helps
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
|
1
Nov. 24
|
1174 | ||
|
1
Apr. 23
|
2526 | ||
|
7
Feb. 23
|
9027 | ||
|
0
Sept. 22
|
1691 | ||
|
1
Juli 22
|
1412 |