-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] dental: Added additional feature
- Added controller in the module as per given task - patient details page - Designed the overall ui of module
- Loading branch information
Showing
16 changed files
with
352 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import dental_controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from odoo import http | ||
from odoo.http import request | ||
|
||
|
||
class DentalController(http.Controller): | ||
|
||
@http.route( | ||
[ | ||
"/home/dental", | ||
], | ||
type="http", | ||
auth="public", | ||
website=True, | ||
) | ||
def show_all_the_data(self, **kwargs): | ||
current_user = request.env.user | ||
custom_data = request.env["dental.patient"].search( | ||
[("gurantor", "=", current_user.id)] | ||
) | ||
return request.render( | ||
"dental.dental_card_controller", | ||
{ | ||
"patients": custom_data, | ||
}, | ||
) | ||
|
||
@http.route( | ||
["/home/dental/<int:record_id>"], | ||
type="http", | ||
auth="user", | ||
website=True, | ||
) | ||
def show_patient_details(self, record_id, **kwargs): | ||
custom_data = request.env["dental.patient"].sudo().browse(record_id) | ||
|
||
return request.render( | ||
"dental.patient_details_controller", | ||
{ | ||
"patients": custom_data, | ||
}, | ||
) | ||
|
||
@http.route( | ||
["/home/dental/appointment/<int:record_id>"], | ||
type="http", | ||
auth="public", | ||
website=True, | ||
) | ||
def show_patient_medical_appointment(self, record_id, **kwargs): | ||
custom_data = request.env["dental.patient"].sudo().browse(record_id) | ||
custom_history = custom_data.history_ids | ||
|
||
return request.render( | ||
"dental.patient_details_controller_appointment", | ||
{ | ||
"patients": custom_history, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.