Skip to content

Commit

Permalink
[IMP] dental: Add breadcrumb and create form view template
Browse files Browse the repository at this point in the history
-Create breadcrumb to all the route
-Create form view for Medical Aid and Personal
-Create list view for Medical History and  Dental History
-Create form view of each Dental History
  • Loading branch information
krku-odoo committed Sep 10, 2024
1 parent 44a3499 commit 550b9d0
Show file tree
Hide file tree
Showing 7 changed files with 434 additions and 91 deletions.
84 changes: 82 additions & 2 deletions dental/controller/dental_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class DentalController(http.Controller):

# show dental on my account
@http.route(
[
"/dental",
Expand Down Expand Up @@ -44,6 +44,7 @@ def show_all_the_data(self, page=1, **kwargs):
},
)

# show all patient
@http.route(
["/patient/<int:record_id>"],
type="http",
Expand All @@ -59,6 +60,65 @@ def show_patient_details(self, record_id, **kwargs):
},
)

# show personal detail
@http.route(
["/personal/detail/<int:record_id>"],
type="http",
auth="public",
website=True,
)
def show_personal_detail(self, record_id, **kwargs):
data = request.env["dental.patients"].sudo().browse(record_id)
return request.render(
"dental.personal_detail_template",
{
"personal": data,
},
)

# show medical Aid detail
@http.route(
["/patients/medical_aid/detail/<int:record_id>"],
type="http",
auth="public",
website=True,
)
def show_medical_aid_detail(self, record_id, **kwargs):
data = request.env["dental.patients"].sudo().browse(record_id)
medical_aid_id = data.medical_aid_id.id
medical_aid = (
request.env["medical.aids"]
.sudo()
.search(
[
("id", "=", medical_aid_id),
],
)
)
return request.render(
"dental.medical_aid_detail_template",
{
"medical_aid": medical_aid,
"patient": data,
},
)

# medical history
@http.route(
["/medical/history/<int:patient_id>"],
type="http",
auth="public",
website=True,
)
def show_medical_history(self, patient_id, **kwargs):
data = request.env["dental.patients"].sudo().browse(patient_id)
history_id = data.history_id
return request.render(
"dental.portal_medical_history_template",
{"history": history_id, "patient": data},
)

# dental history
@http.route(
["/dental/history/<int:patient_id>"],
type="http",
Expand All @@ -67,9 +127,29 @@ def show_patient_details(self, record_id, **kwargs):
)
def show_dental_history(self, patient_id, **kwargs):
data = request.env["dental.patients"].sudo().browse(patient_id)
history_id = data.history_id
return request.render(
"dental.dental_history_view",
{
"patients": data,
"history": history_id,
"patient": data,
},
)

# Dental_history_detail
@http.route(
["/history/detail/<int:history_id>/<int:patient_id>"],
type="http",
auth="public",
website=True,
)
def show_dental_history_detail(self, history_id, patient_id, **kwargs):
patient = request.env["dental.patients"].sudo().browse(patient_id)
data = request.env["pateint.history"].sudo().browse(history_id)
return request.render(
"dental.dental_history_detail_view",
{
"history": data,
"patient": patient,
},
)
1 change: 0 additions & 1 deletion dental/models/medical_aids.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ class MedicalAidsModel(models.Model):
tracking=True,
default="new",
)
pateint_id = fields.One2many("dental.patients", "medical_aid_id")
Binary file added dental/static/icons/dental.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 550b9d0

Please sign in to comment.