multi department
parent
f472cea02d
commit
60c55cd6f1
|
@ -4,6 +4,8 @@
|
|||
<field name="model">clinic.staff.rotation</field>
|
||||
<field name="tabs">[
|
||||
["All",[]],
|
||||
["Nurse",[["type","=","nurse"]]],
|
||||
["Doctor",[["type","=","doctor"]]],
|
||||
["Draft",[["state","=","draft"]]],
|
||||
["Approved",[["state","=","approved"]]]
|
||||
]</field>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<list model="clinic.staff.rotation">
|
||||
<field name="hire_date"/>
|
||||
<field name="staff_id"/>
|
||||
<field name="type"/>
|
||||
<field name="level_id"/>
|
||||
|
|
|
@ -995,6 +995,14 @@ class HDCase(Model):
|
|||
pay_type=payment.pay_type or ''
|
||||
user_id=get_active_user()
|
||||
user=get_model("base.user").browse(user_id)
|
||||
#XXX remove ,
|
||||
index=0
|
||||
for ca in comp_addr:
|
||||
ca=ca.replace(" ","")
|
||||
if ca==',':
|
||||
break
|
||||
index+=1
|
||||
comp_addr=comp_addr[index+1:]
|
||||
data={
|
||||
'comp_name': comp.name or '',
|
||||
'comp_addr': comp_addr or '',
|
||||
|
@ -1002,8 +1010,8 @@ class HDCase(Model):
|
|||
'number': payment.number or '',
|
||||
'ref': payment.ref,
|
||||
'date': payment.date,
|
||||
'datenow': time.strftime("%d/%m/%Y"),
|
||||
'dateprint': time.strftime("%d/%m/%Y %H:%M:%S"),
|
||||
'datenow': payment.date or time.strftime("%d/%m/%Y"),
|
||||
'dateprint': payment.date or time.strftime("%d/%m/%Y %H:%M:%S"),
|
||||
'cust_name': cust_name,
|
||||
'cust_addr': cust_addr,
|
||||
'user_name': user.name or "",
|
||||
|
@ -1015,6 +1023,7 @@ class HDCase(Model):
|
|||
'is_cheque': is_cheque,
|
||||
'is_draft': is_draft,
|
||||
'pay_type': pay_type,
|
||||
'state': payment.state or "",
|
||||
}
|
||||
if pay_type=='direct':
|
||||
data['pay_type']='Cash'
|
||||
|
@ -1035,8 +1044,9 @@ class HDCase(Model):
|
|||
for payment in obj.payments:
|
||||
context['payment_id']=payment.id
|
||||
data=self.get_report_payment_data(context=context)
|
||||
#XXX
|
||||
limit_item=15
|
||||
if data['state']=='draft':
|
||||
limit_item=10
|
||||
for i in range(len(data['lines']),limit_item):
|
||||
data['lines'].append({
|
||||
'no': '',
|
||||
|
|
|
@ -184,9 +184,6 @@ class Patient(Model):
|
|||
if b_ids:
|
||||
return b_ids[0]
|
||||
|
||||
def _get_dpts(self,context={}):
|
||||
return get_model("clinic.department").search([])
|
||||
|
||||
_defaults={
|
||||
#"number": _get_number,
|
||||
"number": "",
|
||||
|
@ -198,11 +195,10 @@ class Patient(Model):
|
|||
"active" : True,
|
||||
'state': 'admit',
|
||||
'walkin': 'no',
|
||||
'departments': _get_dpts,
|
||||
}
|
||||
|
||||
_sql_constraints=("clinic_patient_key_uniq","unique(name_check,branch_id)","name should be unique"),
|
||||
_order="number desc"
|
||||
_order="reg_date desc"
|
||||
|
||||
def check_idcard(self,idcard=''):
|
||||
res=True
|
||||
|
@ -360,6 +356,8 @@ class Patient(Model):
|
|||
'related_id': "clinic.patient,%s"%obj.id,
|
||||
})
|
||||
del vals['addresses']
|
||||
else:
|
||||
obj.simple_address()
|
||||
if obj.rm_remain_visit or vals.get('rm_remain_visit'):
|
||||
visit_ids=get_model('clinic.visit').search([['patient_id','=',obj.id],['state','in',('draft','pending')]])
|
||||
get_model('clinic.visit').delete(visit_ids)
|
||||
|
|
|
@ -529,6 +529,14 @@ class Shop(Model):
|
|||
pay_type=shop.pay_type or ''
|
||||
user_id=get_active_user()
|
||||
user=get_model("base.user").browse(user_id)
|
||||
#XXX remove ,
|
||||
index=0
|
||||
for ca in comp_addr:
|
||||
ca=ca.replace(" ","")
|
||||
if ca==',':
|
||||
break
|
||||
index+=1
|
||||
comp_addr=comp_addr[index+1:]
|
||||
data={
|
||||
'comp_name': comp.name or '',
|
||||
'comp_addr': comp_addr or '',
|
||||
|
@ -536,8 +544,8 @@ class Shop(Model):
|
|||
'number': shop.number or '',
|
||||
'ref': shop.ref,
|
||||
'date': shop.date,
|
||||
'datenow': time.strftime("%d/%m/%Y"),
|
||||
'dateprint': time.strftime("%d/%m/%Y %H:%M:%S"),
|
||||
'datenow': shop.date or time.strftime("%d/%m/%Y"),
|
||||
'dateprint': shop.date or time.strftime("%d/%m/%Y %H:%M:%S"),
|
||||
'cust_name': cust_name,
|
||||
'cust_addr': cust_addr,
|
||||
'note': shop.note or '',
|
||||
|
@ -548,6 +556,7 @@ class Shop(Model):
|
|||
'is_cheque': is_cheque,
|
||||
'is_draft': is_draft,
|
||||
'user_name': user.name or "",
|
||||
'state': shop.state or "",
|
||||
}
|
||||
blank_dot=''
|
||||
if pay_type=='cash':
|
||||
|
@ -572,8 +581,9 @@ class Shop(Model):
|
|||
for obj in get_model('clinic.shop').browse(ids):
|
||||
context['refer_id']=obj.id
|
||||
data=get_model('clinic.shop').get_page(context=context)
|
||||
#XXX fix 15 per page
|
||||
limit_item=15
|
||||
if data['state']=='draft':
|
||||
limit_item=10
|
||||
for i in range(len(data['lines']),limit_item):
|
||||
data['lines'].append({
|
||||
'no': '',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from netforce.model import Model, fields, get_model
|
||||
from netforce.access import get_active_company, get_active_user
|
||||
from netforce.access import get_active_company, get_active_user, set_active_user
|
||||
|
||||
class SickBed(Model):
|
||||
_name="clinic.sickbed"
|
||||
|
@ -13,6 +13,7 @@ class SickBed(Model):
|
|||
patient_id=None
|
||||
image=None
|
||||
date=''
|
||||
set_active_user(1) #FIXME permission denined because of department of patient
|
||||
for hd_case in sorted(obj.hd_cases, key=lambda a: a.id):
|
||||
patient=hd_case.patient_id
|
||||
patient_id=patient.id
|
||||
|
@ -23,6 +24,7 @@ class SickBed(Model):
|
|||
'image': image,
|
||||
'date': date,
|
||||
}
|
||||
set_active_user(get_active_user())
|
||||
return res
|
||||
|
||||
_fields={
|
||||
|
|
|
@ -22,7 +22,7 @@ class StaffRotation(Model):
|
|||
"staff_id": fields.Many2One("clinic.staff","Staff", search=True),
|
||||
'categ_id': fields.Many2One("clinic.staff.categ","Category",search=True),
|
||||
"level_id": fields.Many2One("clinic.staff.level","Level", search=True),
|
||||
"hire_date": fields.Date("Hire Date", search=True),
|
||||
"hire_date": fields.Date("Date", search=True),
|
||||
"resign_date": fields.Date("Resign Date", search=True),
|
||||
"wage": fields.Float("Wage"),
|
||||
"max_cycle": fields.Integer("Max Cycle"),
|
||||
|
@ -40,6 +40,8 @@ class StaffRotation(Model):
|
|||
'type': 'nurse',
|
||||
}
|
||||
|
||||
_order="hire_date desc"
|
||||
|
||||
def to_draft(self,ids,context={}):
|
||||
for obj in self.browse(ids):
|
||||
obj.write({
|
||||
|
|
Binary file not shown.
|
@ -6,3 +6,7 @@
|
|||
|
||||
report cycle item :
|
||||
- sunanna can not see
|
||||
|
||||
report:
|
||||
- reciept:
|
||||
- remove border line
|
||||
|
|
Loading…
Reference in New Issue