clean
parent
07a019c7f4
commit
3201f414c2
|
@ -1,6 +0,0 @@
|
|||
<action>
|
||||
<field name="string">Nationalities</field>
|
||||
<field name="view_cls">multi_view</field>
|
||||
<field name="model">clinic.round</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
|
@ -1,6 +0,0 @@
|
|||
<action>
|
||||
<field name="type">report_odt</field>
|
||||
<field name="model">clinic.round.report</field>
|
||||
<field name="method">get_data</field>
|
||||
<field name="template">round</field>
|
||||
</action>
|
|
@ -1,6 +0,0 @@
|
|||
<action>
|
||||
<field name="string">Schedule</field>
|
||||
<field name="view_cls">multi_view</field>
|
||||
<field name="model">clinic.schedule</field>
|
||||
<field name="menu">clinic_menu</field>
|
||||
</action>
|
|
@ -1,6 +0,0 @@
|
|||
<action>
|
||||
<field name="type">report_odt</field>
|
||||
<field name="model">clinic.round</field>
|
||||
<field name="method">get_data</field>
|
||||
<field name="template">round</field>
|
||||
</action>
|
|
@ -7,7 +7,6 @@
|
|||
<item string="Patients">
|
||||
<item string="Patients" action="clinic_patient"/>
|
||||
<item string="Dialyzers" action="clinic_dialyzer"/>
|
||||
<!--<item string="Schedules" action="clinic_schedule"/>-->
|
||||
<divider/>
|
||||
<header string="OTHERS"/>
|
||||
<item string="Races" action="clinic_race"/>
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
<form model="clinic.schedule">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
</form>
|
|
@ -1,4 +0,0 @@
|
|||
<list model="clinic.schedule">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
</list>
|
|
@ -1,6 +1,7 @@
|
|||
<form model="clinic.visit" attrs='{"readonly":[["state","in",["confirmed"]]]}' show_company="1">
|
||||
<head>
|
||||
<field name="state"/>
|
||||
<button string="Gen No." icon="check" type="primary" method="gen_no"/>
|
||||
<button string="Print" icon="print" action="report_visit_form"/>
|
||||
<button string="Options" dropdown="1">
|
||||
<item string="Copy" method="copy"/>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<list model="clinic.visit">
|
||||
<search>
|
||||
<field name="number"/>
|
||||
<field name="time_start"/>
|
||||
<field name="time_stop"/>
|
||||
<field name="cycle_id"/>
|
||||
<field name="patient_id"/>
|
||||
<field name="doctor_id"/>
|
||||
|
|
|
@ -3,7 +3,6 @@ from datetime import datetime, timedelta
|
|||
|
||||
from netforce.model import Model, fields, get_model
|
||||
from netforce.access import get_active_company, get_active_user, set_active_user
|
||||
#from netforce.utils import get_data_path
|
||||
|
||||
FMT_DATE="%Y-%m-%d %H:%M:%S"
|
||||
|
||||
|
@ -14,6 +13,18 @@ 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):
|
||||
res[obj.id]=datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
return res
|
||||
|
||||
_fields={
|
||||
"number": fields.Char("Number",required=True,search=True),
|
||||
"time_start": fields.DateTime("Time Start",required=True),
|
||||
|
@ -28,6 +39,8 @@ 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"),
|
||||
'print_date': fields.Date('Print Date',function="_get_print_date"),
|
||||
}
|
||||
|
||||
def _get_number(self,context={}):
|
||||
|
@ -248,4 +261,21 @@ class Visit(Model):
|
|||
'state': 'draft',
|
||||
})
|
||||
|
||||
def gen_no(self,ids,context={}):
|
||||
obj=self.browse(ids)[0]
|
||||
if obj.number != '/':
|
||||
return
|
||||
number=self._get_number(context)
|
||||
obj.write({
|
||||
'number': number,
|
||||
})
|
||||
return {
|
||||
'next': {
|
||||
'name': 'clinic_visit',
|
||||
'mode': 'form',
|
||||
'active_id': obj.id,
|
||||
},
|
||||
'flash': 'Gen No OK',
|
||||
}
|
||||
|
||||
Visit.register()
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue