Add Ends-On field in the Lead doctype (#13147)

* add ends_on date in lead to be mapped with calendar event

* set default ends_on to 1 hour from contact_time
This commit is contained in:
Zarrar
2018-03-12 18:49:54 +05:30
committed by Nabin Hait
parent 2f493731ec
commit 0702f29860
4 changed files with 98 additions and 12 deletions

View File

@@ -36,7 +36,8 @@ class TransactionBase(StatusUpdater):
def add_calendar_event(self, opts, force=False):
if cstr(self.contact_by) != cstr(self._prev.contact_by) or \
cstr(self.contact_date) != cstr(self._prev.contact_date) or force:
cstr(self.contact_date) != cstr(self._prev.contact_date) or force or \
(hasattr(self, "ends_on") and cstr(self.ends_on) != cstr(self._prev.ends_on)):
self.delete_events()
self._add_calendar_event(opts)
@@ -58,6 +59,7 @@ class TransactionBase(StatusUpdater):
"subject": opts.subject,
"description": opts.description,
"starts_on": self.contact_date,
"ends_on": opts.ends_on,
"event_type": "Private",
"ref_type": self.doctype,
"ref_name": self.name