diff --git a/netforce_clinic/layouts/clinic_personal_level_list.xml b/netforce_clinic/layouts/clinic_personal_level_list.xml
index dc21ae4..52ac036 100644
--- a/netforce_clinic/layouts/clinic_personal_level_list.xml
+++ b/netforce_clinic/layouts/clinic_personal_level_list.xml
@@ -2,5 +2,6 @@
+
diff --git a/netforce_clinic/layouts/clinic_schedule_calendar.xml b/netforce_clinic/layouts/clinic_schedule_calendar.xml
index 01fb5ad..143affe 100644
--- a/netforce_clinic/layouts/clinic_schedule_calendar.xml
+++ b/netforce_clinic/layouts/clinic_schedule_calendar.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/netforce_clinic/layouts/clinic_schedule_form.xml b/netforce_clinic/layouts/clinic_schedule_form.xml
index 64f3950..7714bc6 100644
--- a/netforce_clinic/layouts/clinic_schedule_form.xml
+++ b/netforce_clinic/layouts/clinic_schedule_form.xml
@@ -5,6 +5,8 @@
+
+
@@ -31,7 +33,6 @@
-
diff --git a/netforce_clinic/models/cycle_item.py b/netforce_clinic/models/cycle_item.py
index 7cea13b..77e6e34 100644
--- a/netforce_clinic/models/cycle_item.py
+++ b/netforce_clinic/models/cycle_item.py
@@ -56,6 +56,7 @@ class CycleItem(Model):
})
return cd_id
+
def create(self, vals,**kw):
date=vals['date']
cycle_id=vals['cycle_id']
diff --git a/netforce_clinic/models/schedule.py b/netforce_clinic/models/schedule.py
index fd7212f..3c7ffaf 100644
--- a/netforce_clinic/models/schedule.py
+++ b/netforce_clinic/models/schedule.py
@@ -11,13 +11,20 @@ class Schedule(Model):
def _get_name(self,ids,context={}):
res={}
for obj in self.browse(ids):
- res[obj.id]='%s'%(obj.date)
+ st="\n" # XXX
+ for line in obj.lines:
+ nurse=line.nurse_id
+ st+='%s %s\n'%(nurse.name, nurse.level_id.name or "")
+ res[obj.id]='%s'%(st)
return res
def _get_item(self,ids,context={}):
res={}
for obj in self.browse(ids):
- item_ids=get_model("clinic.cycle.item").search([['cycle_id','=',obj.cycle_id.id],['date','=',obj.time_start[0:10]]])
+ cycle_id=None
+ if obj.cycle_id:
+ cycle_id=obj.cycle_id.id
+ item_ids=get_model("clinic.cycle.item").search([['cycle_id','=',cycle_id],['date','=',obj.time_start[0:10]]])
item_id=None
if item_ids:
item_id=item_ids[0]
@@ -99,7 +106,14 @@ class Schedule(Model):
'nurse_id': nurse.id,
'level_id': nurse.level_id.id,
}))
- print('xx')
+ if not obj.cycle_item_id:
+ item_id=get_model("clinic.cycle.item").create({
+ 'date': obj.date,
+ 'cycle_id': obj.cycle_id.id,
+ })
+ obj.write({
+ 'cycle_item_id': item_id,
+ })
for nurse in obj.cycle_item_id.nurses:
nurse.delete()
diff --git a/netforce_clinic/models/schedule_copy.py b/netforce_clinic/models/schedule_copy.py
index c527a6b..7a3990d 100644
--- a/netforce_clinic/models/schedule_copy.py
+++ b/netforce_clinic/models/schedule_copy.py
@@ -143,8 +143,8 @@ class ScheduleCopy(Model):
return {
'next': {
'name': 'clinic_schedule',
- 'mode': 'form',
- 'active_id': obj.schedule_id.id,
+ 'mode': 'list',
+ #'active_id': obj.schedule_id.id,
},
'flash': 'Copy successully',
}