Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] estate: initial setup of models, fields, views, and constraints #117

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cc323b9
[ADD] estate: Added a new module estate
pkgu-odoo Aug 1, 2024
edc2a7e
[IMP] estate: created estate_property model
pkgu-odoo Aug 2, 2024
70209e2
[IMP] estate: add menu and custom view for estate_property
pkgu-odoo Aug 2, 2024
ad58d43
[IMP] estate: added new models to the module
pkgu-odoo Aug 5, 2024
e09d15f
[IMP] estate: add some new fields in the exiting models
pkgu-odoo Aug 6, 2024
d8fa4fa
[IMP] estate: update estate_property model and estate_property_offer …
pkgu-odoo Aug 7, 2024
f1d8fee
[IMP] estate: add specific views added several action buttons and con…
pkgu-odoo Aug 8, 2024
1392e98
[IMP] estate: added inheritance models to the estate module
pkgu-odoo Aug 13, 2024
ce6ceb0
[ADD] estate_account: implement new estate_account module
pkgu-odoo Aug 14, 2024
57c7b79
[IMP] estate: implement kanban view
pkgu-odoo Aug 16, 2024
668f3cc
[IMP] estate_account: improve code in estate_property model
pkgu-odoo Aug 20, 2024
7760c59
[IMP] estate: updated attribute names in the estate model.
pkgu-odoo Aug 20, 2024
d07d018
[IMP] estate: disable dragging feature in Kanban view
pkgu-odoo Aug 21, 2024
2d424c3
[IMP] estate: implement 'Add Offer' Wizard for bulk property offers
pkgu-odoo Aug 27, 2024
a93fa0d
[IMP] estate: add standard Real Estate Property Types and demo data
pkgu-odoo Aug 28, 2024
2d10d68
[IMP] estate: add property reports in estate module
pkgu-odoo Aug 30, 2024
587a255
[IMP] estate: add security configurations,update access rights for Es…
pkgu-odoo Aug 30, 2024
ae24353
[ADD] estate: add properties menu with listing and detail page
pkgu-odoo Sep 3, 2024
e060de9
[ADD] dental: added new module
pkgu-odoo Sep 4, 2024
44585cc
[IMP] dental: enhance patient module and portal views
pkgu-odoo Sep 6, 2024
3305815
[ADD] installment: added installment app
pkgu-odoo Sep 16, 2024
41b15c2
[IMP] installments: inplement new feature in the module
pkgu-odoo Sep 23, 2024
35ca567
[ADD] warranty: implemented Warranty Functionality to Sales and Inven…
pkgu-odoo Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dental/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import controllers
28 changes: 28 additions & 0 deletions Dental/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
'name': 'dental',
'version': '1.0',
'summary': 'Manage patient billing and treatment notes',
'description': """
This module helps in managing patient billing, including treatment notes,
consultation types, and other related information.
""",
'category': 'Sales',
'author': 'odoo',
'depends': ['base', 'website', 'mail', 'account'],
'data': [
'security/ir.model.access.csv',
'views/dental_medical_symptoms_allergies_view.xml',
'views/dental_medical_symptoms_chronic_conditions_view.xml',
'views/dental_medical_symptoms_habit_view.xml',
'views/patients_view.xml',
'views/templates.xml',
'views/dental_medical_history_view.xml',
'views/dental_medication_view.xml',
'views/dental_medical_aids.xml',
'views/dental_menu_view.xml'
],
'installable': True,
'application': True,
'auto_install': False,
'license': 'LGPL-3',
}
1 change: 1 addition & 0 deletions Dental/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
56 changes: 56 additions & 0 deletions Dental/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from odoo import http
from odoo.http import request
from odoo.addons.portal.controllers.portal import CustomerPortal


class DentalPortal(CustomerPortal):
@http.route('/my/dental', type='http', auth='user', website=True)
def portal_my_dental(self, **kw):
patients = request.env['dental.patient'].search([('guarantor_name', '=', request.env.user.id)])
return request.render('Dental.portal_my_dental', {
'users': patients
})

@http.route('/my/dental/<int:patient_id>', type='http', auth='user', website=True)
def portal_my_dental_user(self, patient_id, **kw):
patient = request.env['dental.patient'].browse(patient_id)
return request.render('Dental.portal_my_dental_user', {
'patient': patient
})

@http.route('/my/dental/<int:patient_id>/personal', type='http', auth='user', website=True)
def portal_my_dental_personal(self, patient_id, **kw):
patient = request.env['dental.patient'].browse(patient_id)
return request.render('Dental.portal_my_dental_personal', {
'patient': patient
})

@http.route('/my/dental/medical_history/<int:history_id>', type='http', auth='user', website=True)
def portal_dental_medical_history_detail(self, history_id, **kw):
medical_history = request.env['dental.medical.history'].browse(history_id)
if not medical_history.exists():
return request.not_found()
return request.render('Dental.portal_my_dental_medical_history_detail', {
'record': medical_history
})

@http.route('/my/dental/<int:patient_id>/medical_history', type='http', auth='user', website=True)
def portal_my_dental_medical_history_list(self, patient_id, **kw):
history = request.env['dental.medical.history'].search([('patient_id', '=', patient_id)])
return request.render('Dental.portal_my_dental_medical_history_list', {
'history': history
})

@http.route('/my/dental/<int:patient_id>/medical_aid', type='http', auth='user', website=True)
def portal_my_dental_medical_aid(self, patient_id, **kw):
medical_aid = request.env['dental.patient'].browse(patient_id).medical_aids
return request.render('Dental.portal_my_dental_medical_aid', {
'medical_aid': medical_aid
})

@http.route('/my/dental/<int:patient_id>/dental_history', type='http', auth='user', website=True)
def portal_my_dental_dental_history(self, patient_id, **kw):
dental_patient_history = request.env['dental.medical.history'].search([('patient_id', '=', patient_id)])
return request.render('Dental.portal_my_dental_dental_history', {
'dental_patient_history': dental_patient_history
})
7 changes: 7 additions & 0 deletions Dental/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import dental_patients
from . import dental_medical_aids
from . import dental_medical_symptoms_chronic_conditions
from . import dental_medical_symptoms_habit
from . import dental_medical_symptoms_allergies
from . import dental_medication
from . import dental_medical_history
14 changes: 14 additions & 0 deletions Dental/models/dental_medical_aids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from odoo import models, fields


class DentalMedicalAids(models.Model):
_name = 'dental.medical.aids'
_description = 'Medical Aids'
_inherit = ['mail.thread', 'mail.activity.mixin']

name = fields.Char('Name', required=True)
contact = fields.Many2one('res.partner', 'Contact')
phone = fields.Char('Phone')
email = fields.Text('Email')
company_id = fields.Many2one('res.company')
image = fields.Image('Image')
87 changes: 87 additions & 0 deletions Dental/models/dental_medical_history.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
from odoo import models, fields
from datetime import date


class DentalPatientHistory(models.Model):
_name = 'dental.medical.history'
_description = 'Dental Patient History'

name = fields.Char(string="Title", required=True)
description = fields.Text(string="Description")
patient_id = fields.Many2one('dental.patient', string="Patient", required=True)
date = fields.Date(string="Date", default=date.today(), required=True)
main_complaint = fields.Text(string="Main Complaint")
history = fields.Text(string="History")
company_id = fields.Many2one('res.company', string='Company')
did_not_attend = fields.Boolean(string="Did Not Attend")
tags = fields.Char(string="Tags")

xray_file_1 = fields.Binary(string="X-ray File 1")
xray_file_2 = fields.Binary(string="X-ray File 2")
clear_aligner_file_1 = fields.Binary(string="Clear Aligner File 1")
clear_aligner_file_2 = fields.Binary(string="Clear Aligner File 2")

habits = fields.Text(string="Habits")
extra_oral_observation = fields.Text(string="Extra-Oral Observation")

teeth_chart = fields.Char(string="Teeth Chart")

treatment_notes = fields.Text(string="Treatment Notes")

consultation_type = fields.Selection([
('full_consultation', 'Full Consultation with Bitewings and Scan'),
('basic_consultation', 'Basic Consultation'),
('no_consultation', 'No Consultation')
], string="Consultation Type")

call_out = fields.Boolean(string="Call Out")
scale_and_polish = fields.Boolean(string="Scale and Polish")
fluoride = fields.Boolean(string="Fluoride")

filling_description = fields.Text(string="Filling Description")

aligner_delivery = fields.Boolean(
string="Aligner Delivery and Attachment Placed")
whitening = fields.Boolean(string="Whitening")

fissure_sealant_qty = fields.Float(
string="Fissure Sealant Quantity", digits=(6, 2))

attachments_removed = fields.Boolean(string="Attachments Removed")
aligner_followup_scan = fields.Boolean(string="Aligner Follow-up Scan")

other_notes = fields.Text(string="Other Notes")
upper_18_staining = fields.Boolean(string='18 Staining')
upper_17_staining = fields.Boolean(string='17 Staining')
upper_16_staining = fields.Boolean(string='16 Staining')
upper_15_staining = fields.Boolean(string='15 Staining')
upper_14_staining = fields.Boolean(string='14 Staining')
upper_13_staining = fields.Boolean(string='13 Staining')
upper_12_staining = fields.Boolean(string='12 Staining')
upper_11_staining = fields.Boolean(string='11 Staining')
upper_28_staining = fields.Boolean(string='28 Staining')
upper_27_staining = fields.Boolean(string='27 Staining')
upper_26_staining = fields.Boolean(string='26 Staining')
upper_25_staining = fields.Boolean(string='25 Staining')
upper_24_staining = fields.Boolean(string='24 Staining')
upper_23_staining = fields.Boolean(string='23 Staining')
upper_22_staining = fields.Boolean(string='22 Staining')
upper_21_staining = fields.Boolean(string='21 Staining')
lower_31_staining = fields.Boolean(string='31 Staining')
lower_32_staining = fields.Boolean(string='32 Staining')
lower_33_staining = fields.Boolean(string='33 Staining')
lower_34_staining = fields.Boolean(string='34 Staining')
lower_35_staining = fields.Boolean(string='35 Staining')
lower_36_staining = fields.Boolean(string='36 Staining')
lower_37_staining = fields.Boolean(string='37 Staining')
lower_38_staining = fields.Boolean(string='38 Staining')
lower_41_staining = fields.Boolean(string='41 Staining')
lower_42_staining = fields.Boolean(string='42 Staining')
lower_43_staining = fields.Boolean(string='43 Staining')
lower_44_staining = fields.Boolean(string='44 Staining')
lower_45_staining = fields.Boolean(string='45 Staining')
lower_46_staining = fields.Boolean(string='46 Staining')
lower_47_staining = fields.Boolean(string='47 Staining')
lower_48_staining = fields.Boolean(string='48 Staining')

notes = fields.Text(string="Additional Notes")
11 changes: 11 additions & 0 deletions Dental/models/dental_medical_symptoms_allergies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import models, fields


class Allergies(models.Model):
_name = 'dental.allergies'
_description = 'Allergies'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'sequence, name'

sequence = fields.Integer(string="Sequence")
name = fields.Char(string="Name")
11 changes: 11 additions & 0 deletions Dental/models/dental_medical_symptoms_chronic_conditions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class ChronicConditions(models.Model):
_name = 'dental.chronic.conditions'
_description = 'Chronic Conditions'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'sequence, name'

sequence = fields.Integer(string="Sequence")
name = fields.Char(string="Name")
11 changes: 11 additions & 0 deletions Dental/models/dental_medical_symptoms_habit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import models, fields


class Habits(models.Model):
_name = 'dental.habit.substance.abuse'
_description = 'Habits'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'sequence, name'

sequence = fields.Integer(string="Sequence")
name = fields.Char(string="Name")
11 changes: 11 additions & 0 deletions Dental/models/dental_medication.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import models, fields


class DentalMedication(models.Model):
_name = 'dental.medication'
_description = 'Dental Medication'
_order = 'sequence, name'
_inherit = ['mail.thread', 'mail.activity.mixin']

name = fields.Char('Name', required=True)
sequence = fields.Integer('Sequence')
81 changes: 81 additions & 0 deletions Dental/models/dental_patients.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
from odoo import models, fields, Command


class DentalPatient(models.Model):
_name = 'dental.patient'
_description = 'Patient'
_inherit = ['mail.thread', 'mail.activity.mixin']

name = fields.Char(string='Name', required=True)
state = fields.Selection([
('new', 'New'),
('todotoday', 'To Do Today'),
('done', 'Done'),
('toinvoice', 'To Invoice')
], default='new', tracking=True)

gp_id = fields.Many2one('res.partner', string="GP's Name")
gp_phone = fields.Char(related='gp_id.phone', string="GP's Phone", readonly=True)
chronic_conditions = fields.Many2many('dental.chronic.conditions', string="Chronic Conditions")
medication = fields.Many2many('dental.medication', string="Medication")
hospitalized_this_year = fields.Boolean(string="Hospitalised this Year")
allergies = fields.Many2many('dental.allergies', string="Allergies")
habits_substance_abuse = fields.Many2many('dental.habit.substance.abuse', string="Habits and Substance Abuse")
under_specialist_care = fields.Char(string="Under Specialist Care")
psychiatric_history = fields.Char(string="Psychiatric History")
is_pregnant = fields.Boolean(string="Are you pregnant?", default=False)
is_nursing = fields.Boolean(string="Are you nursing?", default=False)
hormone_treatment = fields.Selection([
('hormone', 'Hormone Replacement Treatment'),
('birth_control', 'Birth control'),
('neither', 'Neither')
], string="Are you on...?", default='neither')
medical_aids = fields.Many2one('dental.medical.aids', string="Medical Aids")
medical_aids_plan = fields.Char(string="Medical Aids Plan")
medical_aid_number = fields.Integer(string="Medical Aids Number")
main_member_code = fields.Integer(string="Main Member Code")
depandant_code = fields.Integer(string="Dependant Code")
medical_aids_note = fields.Text(string="Medical Aids Notes")
emergency_contact_id = fields.Many2one('res.partner', string="Emergency Contact")
emergency_contact_mobile = fields.Char(related='emergency_contact_id.phone', string="Mobile", readonly=True)
company_or_school_id = fields.Many2one('res.users', string="Company")
occupation_or_grade = fields.Char(string="Occupation or Grade")
identity_number = fields.Char(string="Identity Number")
date_of_birth = fields.Date(string="Date of Birth")
gender = fields.Selection([
('female', 'Female'),
('male', 'Male'),
('neither', 'Neither')
], string="Gender", default='female')
marital_status = fields.Selection([
('single', 'Single'),
('married', 'Married'),
('divorced', 'Divorced'),
('widowed', 'Widowed')
], string="Marital Status", default='single')
consent_signature = fields.Binary(string="Consent Signature")
consent_date = fields.Date(string="Consent Date")
patient_image = fields.Binary()
guarantor_name = fields.Many2one('res.users', string="Guarantor Name", required=True)
guarantor_mobile = fields.Char(related='guarantor_name.phone', string="Mobile", readonly=True)
guarantor_email = fields.Char(related='guarantor_name.email', string="Email", readonly=True)
guarantor_phone = fields.Char(string="Phone")
tags = fields.Char(string="Tags")
company_id = fields.Many2one('res.company', string="Company")
patient_history_id = fields.One2many('dental.medical.history', 'patient_id', string="History")

def action_book_appointment(self):
self.state = 'toinvoice'
move_vals = {
'partner_id': self.guarantor_name.id,
'move_type': 'out_invoice',
'invoice_date': fields.Date.today(),
"invoice_line_ids": [
Command.create({
"name": "Doctor Appointment fees",
"quantity": 1,
"price_unit": 2000
}),
],
}
self.env['account.move'].create(move_vals)
8 changes: 8 additions & 0 deletions Dental/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_dental_patient,access_dental_patient,model_dental_patient,base.group_user,1,1,1,1
access_dental_medical_aids,access_dental_medical_aids,model_dental_medical_aids,base.group_user,1,1,1,1
access_dental_chronic_conditions,access_dental_chronic_conditions,model_dental_chronic_conditions,base.group_user,1,1,1,1
access_dental_allergies,access_dental_allergies,model_dental_allergies,base.group_user,1,1,1,1
access_dental_habit_substance_abuse,access_dental_habit_substance_abuse,model_dental_habit_substance_abuse,base.group_user,1,1,1,1
access_dental_medication,access_dental_medication,model_dental_medication,base.group_user,1,1,1,1
Dental.access_dental_medical_history,access_dental_medical_history,Dental.model_dental_medical_history,base.group_user,1,1,1,1
Binary file added Dental/static/description/floss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Dental/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions Dental/views/dental_medical_aids.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="action_dental_medical_aids" model="ir.actions.act_window">
<field name="name">Medical Aids</field>
<field name="res_model">dental.medical.aids</field>
<field name="view_mode">tree,form</field>
</record>

<record id="medicalaids_view_form" model="ir.ui.view">
<field name="name">dental.medical.aids.form</field>
<field name="model">dental.medical.aids</field>
<field name="arch" type="xml">
<form string="">
<sheet>
<field name='image' class='oe_avatar' widget='image'></field>
<h1>
<field name="name" placeholder="e.g. Medihelp"/>
</h1>
<group>
<group>
<field name="contact"/>
<field name="phone"/>
<field name="email"/>
</group>
<group>
<field name="company_id"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="activity_ids" widget="chatter" />
<field name="message_ids" widget="mail_thread" />
<field name="message_follower_ids" widget="mail_followers" />
</div>
</form>
</field>
</record>

<record id="medicalaids_tree_view" model="ir.ui.view">
<field name="name">dental.medical.aids.tree</field>
<field name="model">dental.medical.aids</field>
<field name="arch" type="xml">
<tree string="Dental Medical Aids">
<field name="name"/>
<field name="contact"/>
<field name="phone"/>
<field name="email"/>
</tree>
</field>
</record>
</odoo>
Loading