report dialy

conv_bal
watcha.h 2014-11-02 09:13:15 +07:00
parent cd1df26d1e
commit b0680dac69
10 changed files with 62 additions and 26 deletions

View File

@ -0,0 +1,11 @@
<action>
<field name="string">Cycle Dialy</field>
<field name="view_cls">report_view</field>
<field name="model">clinic.cycle.item</field>
<!--<field name="domain">[["order_id.state","in",["confirmed","done"]]]</field>-->
<field name="group_fields">date</field>
<field name="group_select">cycle_id</field>
<!--<field name="group_select">partner_id,product_id,user_id,order_id</field>-->
<!--<field name="sum_fields">amount</field>-->
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,11 @@
<action>
<field name="string">Visit Dialy</field>
<field name="view_cls">report_view</field>
<field name="model">clinic.visit</field>
<!--<field name="domain">[["order_id.state","in",["confirmed","done"]]]</field>-->
<field name="group_fields">visit_date</field>
<field name="group_select">cycle_id</field>
<!--<field name="group_select">partner_id,product_id,user_id,order_id</field>-->
<!--<field name="sum_fields">amount</field>-->
<field name="menu">clinic_menu</field>
</action>

View File

@ -7,19 +7,24 @@
<field name="cycle_id" required="1"/>
<field name="date"/>
<field name="doctors" nolabel="1" span="6">
<list>
<field name="doctor_id"/>
<field name="categ_id"/>
</list>
</field>
<newline/>
<field name="nurses" nolabel="1" span="6">
<list>
<field name="nurse_id"/>
<field name="categ_id"/>
</list>
</field>
<tabs>
<tab string="Nurse">
<field name="nurses" nolabel="1" span="6">
<list>
<field name="nurse_id"/>
<field name="categ_id"/>
</list>
</field>
</tab>
<tab string="Docor">
<field name="doctors" nolabel="1" span="6">
<list>
<field name="doctor_id"/>
<field name="categ_id"/>
</list>
</field>
</tab>
</tabs>
<foot>
</foot>
<related>

View File

@ -30,12 +30,11 @@
<item string="Visits" action="clinic_visit"/>
<item string="HD Cases" action="clinic_hd_case"/>
<item string="Reports">
<header string="HD CASE"/>
<item string="Cycle Dialy" action="clinic_cycle_dialy"/>
<item string="Visit Dialy" action="clinic_visit_dialy"/>
<item string="HD Detail" action="clinic_report_hd_detail"/>
<item string="HD Summary" action="clinic_report_hd_summary"/>
<header string="HD Medical"/>
<item string="Medical Summary" action="clinic_report_hd_medical"/>
<header string="HD Payment"/>
<item string="Payment Summary" action="clinic_report_hd_payment"/>"
<header string="REPORT SETTINGS"/>
<item string="Topics" action="clinic_translate"/>

View File

@ -1,4 +1,5 @@
<form model="clinic.personal.categ">
<field name="name"/>
<field name="parent_id"/>
<field name="type"/>
<field name="parent_id" domain="[['type','=',type]]"/>
</form>

View File

@ -1,4 +1,5 @@
<list model="clinic.personal.categ">
<field name="name"/>
<field name="type"/>
<field name="parent_id"/>
</list>

View File

@ -15,8 +15,8 @@
<field name="expiry_card"/>
<field name="birthday"/>
<field name="department_id"/>
<field name="categ_id"/>
<field name="level_id"/>
<field name="categ_id" domain="[['type','=',type]]"/>
<field name="level_id" domain="[['type','=',type]]"/>
<field name="state"/>
</group>
<group span="6" columns="1">

View File

@ -6,6 +6,7 @@ class PersonalCategory(Model):
_fields={
"name": fields.Char("Name",required=True,search=True),
"type": fields.Selection([("doctor","Doctor"),("nurse","Nurse"),('other','Other')],"Type"),
'parent_id': fields.Many2One("clinic.personal.categ","Parent"),
}

View File

@ -13,12 +13,6 @@ class Visit(Model):
_name_field="number"
_multi_company=True
def _get_visit_date(self,ids,context={}):
res={}
for obj in self.browse(ids):
res[obj.id]=obj.time_start[0:10]
return res
def _get_print_date(self,ids,context={}):
res={}
for obj in self.browse(ids):
@ -39,7 +33,7 @@ class Visit(Model):
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
"state": fields.Selection([["draft","Draft"],["confirmed","Confirmed"],["cancelled","Cancelled"]],"Status",required=True),
"comments": fields.One2Many("message","related_id","Comments"),
'visit_date': fields.Date('Visit Date',function="_get_visit_date"),
'visit_date': fields.Date('Visit Date'),
'print_date': fields.Date('Print Date',function="_get_print_date"),
'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item"), # on_delete="cascade" -> rm visit from cycle item
'sequence': fields.Char("Sequence"),
@ -304,6 +298,7 @@ class Visit(Model):
item_id=item_ids[0]
vals['cycle_item_id']=item_id
vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence
vals['visit_date']=vals['time_start'][0:10]
obj_id=super().create(vals,**kw)
return obj_id
@ -321,4 +316,11 @@ class Visit(Model):
'flash': 'Visit\'s %s has been cancelled'%obj.patient_id.name
}
def write(self,ids,vals,**kw):
cycle_id=vals['cycle_id']
cycle=get_model("clinic.cycle").browse(cycle_id)
vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence
vals['visit_date']=vals['time_start'][0:10]
super().write(ids,vals,**kw)
Visit.register()

View File

@ -1,3 +1,8 @@
missing:
- search calendar
- color calendar
- can not move calendar's schedule
dashboard
: hd summary report -> click and go direct
cycle item: