feat: generate schedule is also triggered on save.
This commit is contained in:
parent
c85c243f9c
commit
1ac471e04f
@ -33,7 +33,7 @@ class MaintenanceSchedule(TransactionBase):
|
|||||||
count = count + 1
|
count = count + 1
|
||||||
child.sales_person = d.sales_person
|
child.sales_person = d.sales_person
|
||||||
|
|
||||||
self.save()
|
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
if not self.get('schedules'):
|
if not self.get('schedules'):
|
||||||
@ -169,9 +169,12 @@ class MaintenanceSchedule(TransactionBase):
|
|||||||
self.validate_maintenance_detail()
|
self.validate_maintenance_detail()
|
||||||
self.validate_dates_with_periodicity()
|
self.validate_dates_with_periodicity()
|
||||||
self.validate_sales_order()
|
self.validate_sales_order()
|
||||||
|
self.generate_schedule()
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
frappe.db.set(self, 'status', 'Draft')
|
frappe.db.set(self, 'status', 'Draft')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def update_amc_date(self, serial_nos, amc_expiry_date=None):
|
def update_amc_date(self, serial_nos, amc_expiry_date=None):
|
||||||
for serial_no in serial_nos:
|
for serial_no in serial_nos:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user