conv_bal
watcha.h@almacom.co.th 2015-01-15 07:59:27 +07:00
parent 04ef418988
commit fedd09355f
5 changed files with 9 additions and 1 deletions

View File

@ -3,4 +3,7 @@
<field name="code"/>
<field name="parent_id"/>
<field name="company_id"/>
<related>
<field name="departments"/>
</related>
</form>

View File

@ -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>

View File

@ -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={

View File

@ -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={}):

View File

@ -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,