conv_bal
watcha.h 2014-11-25 08:41:49 +07:00
parent 6f6d86792f
commit 65c1a36df5
12 changed files with 35 additions and 15 deletions

View File

@ -3,7 +3,7 @@
<field name="state"/> <field name="state"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="New Dialyzer" method="new_dialyzer" states="draft"/> <item string="New Dialyzer" method="new_dialyzer" states="draft"/>
<item string="To Draft" method="to_draft" states="in_progress"/> <item string="To Draft" method="to_draft" states="in_progress,completed"/>
</button> </button>
</head> </head>
<group span="6" columns="1"> <group span="6" columns="1">
@ -109,8 +109,8 @@
<button string="Start" type="success" icon="arrow-right" method="do_treatment" states="draft"/> <button string="Start" type="success" icon="arrow-right" method="do_treatment" states="draft"/>
<button string="Done" type="success" icon="ok" method="done" states="in_progress"/> <button string="Done" type="success" icon="ok" method="done" states="in_progress"/>
<button string="Discontinue" type="danger" icon="remove" action="clinic_hd_case_distcont" states="in_progress"/> <button string="Discontinue" type="danger" icon="remove" action="clinic_hd_case_distcont" states="in_progress"/>
<button string="Undo" type="default" icon="repeat" method="undo" states="completed"/>
<button string="Pay" type="success" icon="ok" action="clinic_payment" states="waiting_payment" /> <button string="Pay" type="success" icon="ok" action="clinic_payment" states="waiting_payment" />
<!--<button string="Undo" type="default" icon="repeat" method="undo" states="completed"/>-->
</foot> </foot>
<related> <related>
<field name="invoices" click_action="view_invoice"> <field name="invoices" click_action="view_invoice">

View File

@ -4,8 +4,8 @@
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Copy" method="copy"/> <item string="Copy" method="copy"/>
<item string="Copy By Duration" action="clinic_schedule_copy"/> <item string="Copy By Duration" action="clinic_schedule_copy"/>
<item string="Load Nurse To Schedule" action="clinic_load_nurses"/> <item string="Copy Nurses To Schedule" action="clinic_load_nurses"/>
<item string="Load Nurses To Cycle Item" method="copy2cycle_item"/> <item string="Copy Nurses To Cycle Item" method="copy2cycle_item"/>
<item string="Clear Nurses" method="clear" states="draft"/> <item string="Clear Nurses" method="clear" states="draft"/>
</button> </button>
</head> </head>

View File

@ -1,10 +1,11 @@
<form model="clinic.visit" attrs='{"readonly":[["state","in",["confirmed"]]]}' show_company="1"> <form model="clinic.visit" attrs='{"readonly":[["state","in",["confirmed","cancelled"]]]}' show_company="1">
<head> <head>
<field name="state"/> <field name="state"/>
<button string="Gen No." icon="check" type="primary" method="gen_no"/> <button string="Gen No." icon="check" type="primary" method="gen_no" states="draft"/>
<button string="Print" icon="print" action="report_visit_form"/> <button string="Print" icon="print" action="report_visit_form"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Copy" method="copy"/> <item string="Copy" method="copy"/>
<item string="To Draft" method="to_draft" states="confirmed,cancelled" />
</button> </button>
</head> </head>
<tabs> <tabs>
@ -32,7 +33,6 @@
<foot> <foot>
<button string="Confirm" type="success" method="confirm" states="draft" /> <button string="Confirm" type="success" method="confirm" states="draft" />
<button string="Discard" type="danger" method="cancel" states="draft" /> <button string="Discard" type="danger" method="cancel" states="draft" />
<button string="To Draft" type="default" icon="repeat" method="to_draft" states="confirmed,cancelled" />
</foot> </foot>
<related> <related>
<field name="hd_cases" readonly="1"/> <field name="hd_cases" readonly="1"/>

View File

@ -436,7 +436,7 @@ class HDCase(Model):
def do_treatment(self,ids,context={}): def do_treatment(self,ids,context={}):
obj=self.browse(ids)[0] obj=self.browse(ids)[0]
if not obj.dialyzers: if not obj.dialyzers:
raise Exception("Can not do treatment without dialyzer!") raise Exception("Please input dialyzer!")
obj.write({"state":"in_progress"}) obj.write({"state":"in_progress"})
def discontinue(self,ids,context={}): def discontinue(self,ids,context={}):

View File

@ -45,9 +45,11 @@ class HDCaseDialy(Model):
dlz=line.dialyzer_id dlz=line.dialyzer_id
dlz_id=dlz.id dlz_id=dlz.id
dlz_number=dlz.number dlz_number=dlz.number
cycle=obj.cycle_id
line={ line={
'cycle_name': obj.cycle_id.name, 'cycle_name': cycle.name,
'cycle_sequence': obj.cycle_id.sequence, 'cycle_sequence': cycle.sequence,
'cycle_color': cycle.color or "",
'hd_case_number': obj.number, 'hd_case_number': obj.number,
'patient_name': obj.patient_id.name, 'patient_name': obj.patient_id.name,
'patient_type': patient_type, 'patient_type': patient_type,

View File

@ -202,6 +202,7 @@ class ReportHDCaseSummary(Model):
} }
medicals=get_model("clinic.report.medical.summary").get_report_data(ids=[],context=context)['lines'] medicals=get_model("clinic.report.medical.summary").get_report_data(ids=[],context=context)['lines']
year=year+543
data={ data={
'date': date, 'date': date,
'month': month_str, 'month': month_str,

View File

@ -104,6 +104,7 @@ class ReportMedicalSummary(Model):
'nhso': utils.PATIENT_TYPE['nhso'], 'nhso': utils.PATIENT_TYPE['nhso'],
'personal': utils.PATIENT_TYPE['personal'], 'personal': utils.PATIENT_TYPE['personal'],
} }
year=int(year)+543
data={ data={
'company_name': company.name or "", 'company_name': company.name or "",
'parent_company_name': company.parent_id.name or "", 'parent_company_name': company.parent_id.name or "",

View File

@ -120,6 +120,17 @@ class Schedule(Model):
'cycle_item_id': item_id, 'cycle_item_id': item_id,
}) })
cycles.update({cycle.name}) cycles.update({cycle.name})
else:
item_id=get_model("clinic.cycle.item").create({
'cycle_id': cycle.id,
'date': date,
})
items[item_id]=[]
items[item_id].append(('create',{
'nurse_id': nurse.id,
'level_id': nurse.level_id.id,
}))
cycles.update({cycle.name})
for item_id, nurses in items.items(): for item_id, nurses in items.items():
item=get_model("clinic.cycle.item").browse(item_id) item=get_model("clinic.cycle.item").browse(item_id)
@ -129,7 +140,8 @@ class Schedule(Model):
'nurses': nurses, 'nurses': nurses,
}) })
msg='Load nurses to cycle item %s successfully'%(','.join(list(cycles))) cycles=list(reversed(list(cycles)))
msg='Copy nurses to cycle item %s successfully'%(','.join(cycles))
# TODO create cycle item automatically # TODO create cycle item automatically
if not items: if not items:
msg='No cycle item to copy' msg='No cycle item to copy'

View File

@ -16,7 +16,7 @@ class SettingLevel(Model):
'var_a': fields.Char("Ax"), 'var_a': fields.Char("Ax"),
"op": fields.Selection([["+","+"],["-","-"],["*","*"],["/","/"]],"Operation"), "op": fields.Selection([["+","+"],["-","-"],["*","*"],["/","/"]],"Operation"),
'var_b': fields.Char("B"), 'var_b': fields.Char("B"),
'formular': fields.Text("Formular",function="_get_formular"), 'formular': fields.Text("Formular (Ax op B)",function="_get_formular"),
} }
SettingLevel.register() SettingLevel.register()

View File

@ -347,7 +347,7 @@ class Visit(Model):
def gen_no(self,ids,context={}): def gen_no(self,ids,context={}):
obj=self.browse(ids)[0] obj=self.browse(ids)[0]
if obj.number != '/': if obj.number != '/' or obj.state!='draft':
return return
number=self._get_number(context) number=self._get_number(context)
obj.write({ obj.write({
@ -359,7 +359,7 @@ class Visit(Model):
'mode': 'form', 'mode': 'form',
'active_id': obj.id, 'active_id': obj.id,
}, },
'flash': 'Gen No OK', 'flash': 'Generate number succesfully',
} }
def create(self, vals,**kw): def create(self, vals,**kw):

View File

@ -33,7 +33,7 @@
<td>{{currency fee_amount}}</td> <td>{{currency fee_amount}}</td>
<td>-</td> <td>-</td>
<td><a href="/ui#name=clinic_hd_case&active_id={{hd_case_id}}&mode=form">{{hd_case_number}}</a></td> <td><a href="/ui#name=clinic_hd_case&active_id={{hd_case_id}}&mode=form">{{hd_case_number}}</a></td>
<td><a href="/ui#name=clinic_hd_dialyzer&active_id={{dlz_id}}&mode=form">{{dlz_number}}</a></td> <td><a href="/ui#name=clinic_dialyzer&active_id={{dlz_id}}&mode=form">{{dlz_number}}</a></td>
<td>-</td> <td>-</td>
<td>-</td> <td>-</td>
<td>{{note}}</td> <td>{{note}}</td>

View File

@ -1,4 +1,8 @@
======= =======
- design
- auto complete hd after time out
- create payment for each type of patient
- invoice
- define rule to get - define rule to get
- fee product - fee product
- invoice - invoice