diff --git a/dental/__init__.py b/dental/__init__.py index 0650744f6..5607426d8 100644 --- a/dental/__init__.py +++ b/dental/__init__.py @@ -1 +1,2 @@ from . import models +from . import controller diff --git a/dental/__manifest__.py b/dental/__manifest__.py index 789463ea3..d007109f6 100644 --- a/dental/__manifest__.py +++ b/dental/__manifest__.py @@ -7,12 +7,13 @@ "version": "0.1", "application": True, "installable": True, - "depends": ["base", "mail", "account"], + "depends": ["base", "mail", "account", "website"], "data": [ "security/ir.model.access.csv", "report/dental_patient_report_view.xml", "report/dental_patient_report_action.xml", "views/patient_history_form_tree_view.xml", + "views/dental_controller.xml", "views/dental_views.xml", "views/patient_history_views.xml", "views/dental_menus.xml", diff --git a/dental/controller/__init__.py b/dental/controller/__init__.py new file mode 100644 index 000000000..95db74ea1 --- /dev/null +++ b/dental/controller/__init__.py @@ -0,0 +1 @@ +from . import dental_controller diff --git a/dental/controller/dental_controller.py b/dental/controller/dental_controller.py new file mode 100644 index 000000000..e82ab7c40 --- /dev/null +++ b/dental/controller/dental_controller.py @@ -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/"], + 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/"], + 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, + }, + ) diff --git a/dental/models/dental_patient.py b/dental/models/dental_patient.py index 501847253..514e01f0a 100644 --- a/dental/models/dental_patient.py +++ b/dental/models/dental_patient.py @@ -1,6 +1,5 @@ -from datetime import datetime, timedelta, date +from datetime import date from odoo import fields, models, api, Command -from odoo.exceptions import UserError, ValidationError class DentalPatient(models.Model): @@ -79,7 +78,6 @@ class DentalPatient(models.Model): def create_patient_invoice(self): if self.state == "toinvoice": for record in self: - print(record.gurantor.id) values_property = { "partner_id": record.gurantor.partner_id.id, "move_type": "out_invoice", diff --git a/dental/static/description/Bill.svg b/dental/static/description/Bill.svg new file mode 100644 index 000000000..51d1968db --- /dev/null +++ b/dental/static/description/Bill.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/dental/static/description/bag.svg b/dental/static/description/bag.svg new file mode 100644 index 000000000..148d08a22 --- /dev/null +++ b/dental/static/description/bag.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dental/static/description/folder.svg b/dental/static/description/folder.svg new file mode 100644 index 000000000..e25122ed5 --- /dev/null +++ b/dental/static/description/folder.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/dental/static/description/icon.svg b/dental/static/description/icon.svg new file mode 100644 index 000000000..12e8ec084 --- /dev/null +++ b/dental/static/description/icon.svg @@ -0,0 +1 @@ + diff --git a/dental/static/description/image.png b/dental/static/description/image.png new file mode 100644 index 000000000..5ae977aff Binary files /dev/null and b/dental/static/description/image.png differ diff --git a/dental/static/description/tasks.svg b/dental/static/description/tasks.svg new file mode 100644 index 000000000..d43aeaacd --- /dev/null +++ b/dental/static/description/tasks.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/dental/views/dental_controller.xml b/dental/views/dental_controller.xml new file mode 100644 index 000000000..a85b3dcbf --- /dev/null +++ b/dental/views/dental_controller.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dental/views/dental_patient_views.xml b/dental/views/dental_patient_views.xml index 1daea377f..4edf070a4 100644 --- a/dental/views/dental_patient_views.xml +++ b/dental/views/dental_patient_views.xml @@ -22,7 +22,6 @@ - @@ -31,7 +30,6 @@ - @@ -50,7 +48,6 @@ - @@ -64,14 +61,12 @@ - - @@ -108,9 +103,7 @@ - - @@ -125,7 +118,6 @@ - dental.patient.view.kanban dental.patient @@ -136,10 +128,9 @@
-
+ class="img-fluid rounded-circle " />
@@ -169,7 +160,6 @@ - @@ -181,12 +171,12 @@ - + tree.view.mdication medical.aids @@ -210,6 +200,7 @@ + medical.aids.form.view medication @@ -235,6 +226,8 @@ + + medical.aids.form.view chronic.condition @@ -248,6 +241,7 @@ + tree.view.mdication @@ -260,8 +254,9 @@ + - medical.aids.form.view + medical.Allergies.form.view allergies
@@ -273,20 +268,22 @@
+ tree.view.mdication habits - + + - medical.aids.form.view + medical.habits.form.view habits
@@ -298,5 +295,4 @@
- \ No newline at end of file diff --git a/dental/views/dental_views.xml b/dental/views/dental_views.xml index 900ea9b7c..38f6eb020 100644 --- a/dental/views/dental_views.xml +++ b/dental/views/dental_views.xml @@ -16,13 +16,13 @@ - Medical Help medical.aids tree,form + Chronic Conditions @@ -30,6 +30,7 @@ tree,form + Allergies allergies @@ -37,17 +38,17 @@ + Habits habits tree,form + Medication medication tree,form - - \ No newline at end of file diff --git a/dental/views/patient_history_form_tree_view.xml b/dental/views/patient_history_form_tree_view.xml index 8cd35458f..7b1b992b9 100644 --- a/dental/views/patient_history_form_tree_view.xml +++ b/dental/views/patient_history_form_tree_view.xml @@ -1,5 +1,6 @@ + dental.patient.history.tree patient.history @@ -13,6 +14,7 @@ + dental.patient.history.form patient.history @@ -52,7 +54,7 @@
-
18
+
18
17
16
15
@@ -145,5 +147,4 @@ - \ No newline at end of file diff --git a/dental/views/patient_history_views.xml b/dental/views/patient_history_views.xml index 606d50485..b40a70b48 100644 --- a/dental/views/patient_history_views.xml +++ b/dental/views/patient_history_views.xml @@ -1,4 +1,5 @@ + History patient.history