multi company
parent
1a537a1649
commit
d3aaf9798d
|
@ -3,6 +3,5 @@
|
|||
<!--<field name="code"/>-->
|
||||
<field name="parent_id"/>
|
||||
<field name="pick_out_journal_id"/>
|
||||
<field name="branch_id"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
</form>
|
||||
|
|
|
@ -2,5 +2,4 @@
|
|||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="branch_id"/>
|
||||
</list>
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
<field name="department_id" span="2"/>
|
||||
<field name="cycle_item_id" span="2" domain="[['cycle_id','=',cycle_id]]"/>
|
||||
<field name="visit_id" span="2"/>
|
||||
<field name="branch_id" span="2"/>
|
||||
<field name="req_fee" span="2" invisible="1"/>
|
||||
<field name="company_id" span="2" invisible="1"/> <!-- to show company name, don't remove -->
|
||||
<field name="hct_include" span="2" invisible="1"/>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<field name="categ_id"/>
|
||||
<field name="doctor_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="branch_id"/>
|
||||
<tabs>
|
||||
<tab string="General Information">
|
||||
<group span="6" columns="1">
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<field name="trt_no"/>
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="branch_id"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="type_id"/>
|
||||
<field name="image" preview='1'/>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<field name="name_eng"/>
|
||||
<field name="nick_name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="branch_id"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<tabs>
|
||||
<tab string="General">
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
<field name="number"/>
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="branch_id"/>
|
||||
<field name="level_id"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="type"/>
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
<field name="time_start" onchange="onchange_datefrom"/>
|
||||
<field name="cycle_id" onchange="onchange_cycle" required="1"/>
|
||||
<field name="department_id"/>
|
||||
<field name="branch_id"/>
|
||||
</group>
|
||||
<group span="6" columns="1">
|
||||
<field name="patient_id" onchange="onchange_patient"/>
|
||||
|
|
|
@ -48,7 +48,6 @@ class Cycle(Model):
|
|||
'color': fields.Char("Color"),
|
||||
'note': fields.Text("Note"),
|
||||
'company_id': fields.Many2One("company", "Company"),
|
||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
|
|
|
@ -38,7 +38,6 @@ class CycleItem(Model):
|
|||
'user_id': fields.Many2One("base.user","Validator"),
|
||||
"comments": fields.One2Many("message","related_id","Comments"), "company_id": fields.Many2One("company","Company"),
|
||||
'company_id': fields.Many2One("company", "Company"),
|
||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||
}
|
||||
|
||||
def _get_vark(self,context={}):
|
||||
|
|
|
@ -11,7 +11,6 @@ class Department(Model):
|
|||
"code": fields.Char("Code",search=True),
|
||||
"parent_id": fields.Many2One("clinic.department", "Parent"),
|
||||
'company_id': fields.Many2One("company","Company"),
|
||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||
"pick_out_journal_id": fields.Many2One("stock.journal","Stock Journal",required=True),
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,6 @@ class HDCase(Model):
|
|||
'req_fee': fields.Integer("Request Expense"),
|
||||
'hd_case_id': fields.Many2One("clinic.hd.case","HD",function="_get_all",function_multi=True), # XXX
|
||||
'company_id': fields.Many2One("company","Company"),
|
||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||
}
|
||||
|
||||
def _get_number(self,context={}):
|
||||
|
@ -210,7 +209,6 @@ class HDCase(Model):
|
|||
if patient_id:
|
||||
patient=get_model('clinic.patient').browse(patient_id)
|
||||
department=patient.department_id
|
||||
branch=patient.branch_id
|
||||
cycle=patient.cycle_id
|
||||
partner=patient.type_id.contact_id
|
||||
if partner:
|
||||
|
@ -218,7 +216,6 @@ class HDCase(Model):
|
|||
else:
|
||||
data['fee_partner_id']=None
|
||||
data['department_id']=department.id
|
||||
data['branch_id']=branch.id
|
||||
data['cycle_id']=cycle.id
|
||||
data['patient_type_id']=patient.type_id.id
|
||||
if patient.type_id.hct_include:
|
||||
|
@ -979,9 +976,6 @@ class HDCase(Model):
|
|||
def create(self,vals,**kw):
|
||||
patient_id=vals['patient_id']
|
||||
vals=self.get_staff_line(vals,patient_id)
|
||||
if not vals.get("branch_id"):
|
||||
patient=get_model("clinic.patient").browse(patient_id)
|
||||
vals['branch_id']=patient.branch_id.id
|
||||
new_id=super().create(vals,**kw)
|
||||
self.function_store([new_id])
|
||||
return new_id
|
||||
|
|
|
@ -98,7 +98,6 @@ class Patient(Model):
|
|||
"documents": fields.One2Many("document","related_id","Documents"),
|
||||
'resign_date': fields.Date("Resign Date"),
|
||||
'rm_remain_visit': fields.Boolean("Auto Remove Remaining Visit"),
|
||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||
'department_id': fields.Many2One("clinic.department","Department"),
|
||||
'cycle_id': fields.Many2One("clinic.cycle","Last Cycle",function="_get_last_cycle"),
|
||||
}
|
||||
|
|
|
@ -113,7 +113,6 @@ class Staff(Model):
|
|||
"rotations": fields.One2Many("clinic.staff.rotation","staff_id","Staff Rotation"),
|
||||
"cycles": fields.One2Many("clinic.staff.cycle","staff_id","Cycles"),
|
||||
'cycle_id': fields.Many2One('clinic.cycle','Last Cycle',function="_get_cycle"),
|
||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||
"hd_case_staffs": fields.One2Many("clinic.hd.case.staff","staff_id","HD Cases"),
|
||||
"hd_cases": fields.Many2Many("clinic.hd.case","HD Cases",function="_get_hdcase"), # not need to use (it's slow to load)
|
||||
"cycle_item_nurses": fields.One2Many("clinic.cycle.item.nurse","nurse_id","Cycle Items"),
|
||||
|
|
|
@ -51,7 +51,6 @@ class Visit(Model):
|
|||
'visit_date': fields.Date('Visit Date'),
|
||||
'cycle_color': fields.Char('Color',function="_get_all",function_multi=True,store=True),
|
||||
'note': fields.Text('Note'),
|
||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||
}
|
||||
|
||||
def _get_number(self,context={}):
|
||||
|
@ -280,15 +279,8 @@ class Visit(Model):
|
|||
elif patient.department_id:
|
||||
department_id=patient.department_id.id
|
||||
|
||||
branch_id=None
|
||||
if visit.branch_id:
|
||||
branch_id=visit.branch_id.id
|
||||
elif patient.branch_id:
|
||||
branch_id=patient.branch_id.id
|
||||
|
||||
data['doctor_id']=doctor.id
|
||||
data['department_id']=department_id
|
||||
data['branch_id']=branch_id
|
||||
|
||||
if not patient.doctor_id:
|
||||
patient.write({
|
||||
|
|
Loading…
Reference in New Issue