active dpt and brch
parent
a6e008d0d4
commit
8c14f45d8b
|
@ -2,5 +2,6 @@
|
||||||
<field name="string">Branches</field>
|
<field name="string">Branches</field>
|
||||||
<field name="view_cls">multi_view</field>
|
<field name="view_cls">multi_view</field>
|
||||||
<field name="model">clinic.branch</field>
|
<field name="model">clinic.branch</field>
|
||||||
|
<field name="tabs">[["All",[]],["Archived",[["active","=","False"]]]]</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
</action>
|
</action>
|
||||||
|
|
|
@ -2,5 +2,6 @@
|
||||||
<field name="string">Departments</field>
|
<field name="string">Departments</field>
|
||||||
<field name="view_cls">multi_view</field>
|
<field name="view_cls">multi_view</field>
|
||||||
<field name="model">clinic.department</field>
|
<field name="model">clinic.department</field>
|
||||||
|
<field name="tabs">[["All",[]],["Archived",[["active","=","False"]]]]</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
</action>
|
</action>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="parent_id"/>
|
<field name="parent_id"/>
|
||||||
<field name="company_id"/>
|
<field name="company_id"/>
|
||||||
|
<field name="active"/>
|
||||||
<related>
|
<related>
|
||||||
<field name="departments"/>
|
<field name="departments"/>
|
||||||
</related>
|
</related>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="parent_id"/>
|
<field name="parent_id"/>
|
||||||
<field name="pick_out_journal_id"/>
|
<field name="pick_out_journal_id"/>
|
||||||
|
<field name="active"/>
|
||||||
<field name="branch_id" required="1"/>
|
<field name="branch_id" required="1"/>
|
||||||
<field name="company_id" invisible="1"/>
|
<field name="company_id" invisible="1"/>
|
||||||
<related>
|
<related>
|
||||||
|
|
|
@ -11,10 +11,12 @@ class Branch(Model):
|
||||||
"parent_id": fields.Many2One("clinic.branch","Parent"),
|
"parent_id": fields.Many2One("clinic.branch","Parent"),
|
||||||
"company_id": fields.Many2One("company","Company"),
|
"company_id": fields.Many2One("company","Company"),
|
||||||
'departments': fields.One2Many("clinic.department","branch_id","Departments"),
|
'departments': fields.One2Many("clinic.department","branch_id","Departments"),
|
||||||
|
'active': fields.Boolean("Active"),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
|
'active': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
Branch.register()
|
Branch.register()
|
||||||
|
|
|
@ -15,6 +15,7 @@ class Department(Model):
|
||||||
"pick_out_journal_id": fields.Many2One("stock.journal","Stock Journal",required=True),
|
"pick_out_journal_id": fields.Many2One("stock.journal","Stock Journal",required=True),
|
||||||
'patients': fields.One2Many("clinic.patient","department_id","Patients"),
|
'patients': fields.One2Many("clinic.patient","department_id","Patients"),
|
||||||
'staffs': fields.One2Many("clinic.staff","department_id","Staffs"),
|
'staffs': fields.One2Many("clinic.staff","department_id","Staffs"),
|
||||||
|
'active': fields.Boolean("Active"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_branch(self,context={}):
|
def _get_branch(self,context={}):
|
||||||
|
@ -25,6 +26,7 @@ class Department(Model):
|
||||||
_defaults={
|
_defaults={
|
||||||
'company_id': lambda *a: get_active_company(),
|
'company_id': lambda *a: get_active_company(),
|
||||||
'branch_id': _get_branch,
|
'branch_id': _get_branch,
|
||||||
|
'active': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
_order="name"
|
_order="name"
|
||||||
|
|
|
@ -91,6 +91,14 @@ class ClinicSetting(Model):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def run_script(self,ids,context={}):
|
def run_script(self,ids,context={}):
|
||||||
|
db=get_connection()
|
||||||
|
db.execute("""
|
||||||
|
update clinic_branch set active=True;
|
||||||
|
update clinic_department set active=True;
|
||||||
|
""")
|
||||||
|
print("Done!")
|
||||||
|
return
|
||||||
|
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
################ update sickbed #############
|
################ update sickbed #############
|
||||||
#sickbed: update department
|
#sickbed: update department
|
||||||
|
|
Loading…
Reference in New Issue