xxxx
parent
4dc04c5658
commit
9897ef9e35
|
@ -12,7 +12,6 @@ from . import patient_cause_line
|
|||
from . import patient_comorbidity_line
|
||||
from . import patient_morbidity_line
|
||||
from . import race
|
||||
from . import schedule
|
||||
from . import setting
|
||||
from . import visit
|
||||
from . import visit_line
|
||||
|
|
|
@ -62,7 +62,6 @@ class Visit(Model):
|
|||
|
||||
def _get_nurse(self,context={}):
|
||||
user_id=get_active_user()
|
||||
print("user_id ",user_id)
|
||||
nurse_ids=get_model("clinic.nurse").search([['user_id','=',user_id]])
|
||||
if nurse_ids:
|
||||
return nurse_ids[0]
|
||||
|
@ -71,18 +70,20 @@ class Visit(Model):
|
|||
def _get_time_start(self,context={}):
|
||||
now=datetime.now()
|
||||
starttime=now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
print(":>> ", starttime)
|
||||
return starttime
|
||||
|
||||
def _get_time_stop(self,context={}):
|
||||
hr=timedelta(seconds=3600)
|
||||
now=datetime.now()
|
||||
stoptime=(now+hr).strftime("%Y-%m-%d %H:%M:%S")
|
||||
print('::: ', stoptime)
|
||||
return stoptime
|
||||
|
||||
_defaults={
|
||||
"state": "draft",
|
||||
'time_start': _get_time_start,
|
||||
'time_stop': _get_time_stop,
|
||||
#'time_start': _get_time_start,
|
||||
#'time_stop': _get_time_stop,
|
||||
"number": "/",
|
||||
"company_id": lambda *a: get_active_company(),
|
||||
'nurse_id': _get_nurse,
|
||||
|
|
Loading…
Reference in New Issue