Infer number_of_agents from agent_list in apppointment booking settings
This commit is contained in:
parent
539ea2cefb
commit
c8e66a0f71
@ -29,8 +29,10 @@
|
|||||||
"default": "1",
|
"default": "1",
|
||||||
"fieldname": "number_of_agents",
|
"fieldname": "number_of_agents",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
|
"hidden": 1,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Number of Concurrent Appointments",
|
"label": "Number of Concurrent Appointments",
|
||||||
|
"read_only": 1,
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -99,7 +101,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"modified": "2019-11-19 10:53:26.935061",
|
"modified": "2019-11-20 10:23:37.393363",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "CRM",
|
"module": "CRM",
|
||||||
"name": "Appointment Booking Settings",
|
"name": "Appointment Booking Settings",
|
||||||
|
@ -16,6 +16,12 @@ class AppointmentBookingSettings(Document):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_availability_of_slots()
|
self.validate_availability_of_slots()
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
self.infer_number_of_agents()
|
||||||
|
|
||||||
|
def infer_number_of_agents():
|
||||||
|
self.number_of_agents = len(self.agent_list)
|
||||||
|
|
||||||
def validate_availability_of_slots(self):
|
def validate_availability_of_slots(self):
|
||||||
for record in self.availability_of_slots:
|
for record in self.availability_of_slots:
|
||||||
from_time = datetime.datetime.strptime(
|
from_time = datetime.datetime.strptime(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user