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="cycle_id" required="1"/>
<field name="date"/> <field name="date"/>
<field name="doctors" nolabel="1" span="6"> <tabs>
<list> <tab string="Nurse">
<field name="doctor_id"/> <field name="nurses" nolabel="1" span="6">
<field name="categ_id"/> <list>
</list> <field name="nurse_id"/>
</field> <field name="categ_id"/>
<newline/> </list>
<field name="nurses" nolabel="1" span="6"> </field>
<list> </tab>
<field name="nurse_id"/> <tab string="Docor">
<field name="categ_id"/> <field name="doctors" nolabel="1" span="6">
</list> <list>
</field> <field name="doctor_id"/>
<field name="categ_id"/>
</list>
</field>
</tab>
</tabs>
<foot> <foot>
</foot> </foot>
<related> <related>

View File

@ -30,12 +30,11 @@
<item string="Visits" action="clinic_visit"/> <item string="Visits" action="clinic_visit"/>
<item string="HD Cases" action="clinic_hd_case"/> <item string="HD Cases" action="clinic_hd_case"/>
<item string="Reports"> <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 Detail" action="clinic_report_hd_detail"/>
<item string="HD Summary" action="clinic_report_hd_summary"/> <item string="HD Summary" action="clinic_report_hd_summary"/>
<header string="HD Medical"/>
<item string="Medical Summary" action="clinic_report_hd_medical"/> <item string="Medical Summary" action="clinic_report_hd_medical"/>
<header string="HD Payment"/>
<item string="Payment Summary" action="clinic_report_hd_payment"/>" <item string="Payment Summary" action="clinic_report_hd_payment"/>"
<header string="REPORT SETTINGS"/> <header string="REPORT SETTINGS"/>
<item string="Topics" action="clinic_translate"/> <item string="Topics" action="clinic_translate"/>

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@ class PersonalCategory(Model):
_fields={ _fields={
"name": fields.Char("Name",required=True,search=True), "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"), 'parent_id': fields.Many2One("clinic.personal.categ","Parent"),
} }

View File

@ -12,12 +12,6 @@ class Visit(Model):
_audit_log=True _audit_log=True
_name_field="number" _name_field="number"
_multi_company=True _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={}): def _get_print_date(self,ids,context={}):
res={} res={}
@ -39,7 +33,7 @@ class Visit(Model):
"cycle_id": fields.Many2One("clinic.cycle","Cycle"), "cycle_id": fields.Many2One("clinic.cycle","Cycle"),
"state": fields.Selection([["draft","Draft"],["confirmed","Confirmed"],["cancelled","Cancelled"]],"Status",required=True), "state": fields.Selection([["draft","Draft"],["confirmed","Confirmed"],["cancelled","Cancelled"]],"Status",required=True),
"comments": fields.One2Many("message","related_id","Comments"), "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"), '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 'cycle_item_id': fields.Many2One("clinic.cycle.item","Cycle Item"), # on_delete="cascade" -> rm visit from cycle item
'sequence': fields.Char("Sequence"), 'sequence': fields.Char("Sequence"),
@ -304,6 +298,7 @@ class Visit(Model):
item_id=item_ids[0] item_id=item_ids[0]
vals['cycle_item_id']=item_id vals['cycle_item_id']=item_id
vals['sequence']='%s-%s'%(vals['time_start'][0:10],cycle.sequence) #date-sequence 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) obj_id=super().create(vals,**kw)
return obj_id return obj_id
@ -320,5 +315,12 @@ class Visit(Model):
}, },
'flash': 'Visit\'s %s has been cancelled'%obj.patient_id.name '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() Visit.register()

View File

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