improve
parent
04ef418988
commit
fedd09355f
|
@ -3,4 +3,7 @@
|
|||
<field name="code"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="company_id"/>
|
||||
<related>
|
||||
<field name="departments"/>
|
||||
</related>
|
||||
</form>
|
||||
|
|
|
@ -5,4 +5,7 @@
|
|||
<field name="pick_out_journal_id"/>
|
||||
<field name="branch_id" required="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<related>
|
||||
<field name="patients"/>
|
||||
</related>
|
||||
</form>
|
||||
|
|
|
@ -10,6 +10,7 @@ class Branch(Model):
|
|||
"code": fields.Char("Code",required=True,search=True),
|
||||
"parent_id": fields.Many2One("clinic.branch","Parent"),
|
||||
"company_id": fields.Many2One("company","Company"),
|
||||
'departments': fields.One2Many("clinic.department","branch_id","Departments"),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
|
|
|
@ -13,6 +13,7 @@ class Department(Model):
|
|||
'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),
|
||||
'patients': fields.One2Many("clinic.patient","department_id","Patients"),
|
||||
}
|
||||
|
||||
def _get_branch(self,context={}):
|
||||
|
|
|
@ -145,7 +145,7 @@ class GenVisit(Model):
|
|||
'patient_id': patient_id,
|
||||
'doctor_id': obj.doctor_id.id or patient.doctor_id.id,
|
||||
'department_id': patient.department_id.id,
|
||||
'branch_id': branch_id,
|
||||
'branch_id': patient.branch_id.id or branch_id,
|
||||
'cycle_id': days[weekday]['cycle_id'],
|
||||
'time_start': ttime_start,
|
||||
'time_stop': ttime_stop,
|
||||
|
|
Loading…
Reference in New Issue