Skip to content

Commit

Permalink
[ADD] dental: added new module
Browse files Browse the repository at this point in the history
after this commit: -
- implemented models
- implemented views, action , menu for the corresponding models
  • Loading branch information
niku-odoo committed Sep 4, 2024
1 parent 13d257e commit 19ec879
Show file tree
Hide file tree
Showing 21 changed files with 563 additions and 0 deletions.
1 change: 1 addition & 0 deletions dental/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions dental/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
'name': 'Dental',
'version': '17.0',
'summary': 'Manage Dental Patients , Appointments and Medical Record',
'author': 'Your Name',
'depends': ['base'],
'license': 'LGPL-3',
'data': [
'security/ir.model.access.csv',
'views/dental_patient_views.xml',
'views/dental_medical_aids_view.xml',
'views/dental_medical_symptoms_view.xml',
'views/dental_medication_views.xml',
'views/dental_chronic_conditions_views.xml',
'views/dental_allergies_view.xml',
'views/dental_habits_view.xml',
'views/dental_configuration_views.xml',
'views/dental_patient_menus.xml',
],
'installable': True,
'application': True,
}
8 changes: 8 additions & 0 deletions dental/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from . import dental_patient
from . import dental_medical_aids
from . import dental_medical_symptoms
from . import dental_medication
from . import dental_chronic_conditions
from . import dental_allergies
from . import dental_habits
from . import dental_configuration
9 changes: 9 additions & 0 deletions dental/models/dental_allergies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import api, models, fields


class DentalAllergies(models.Model):

_name = "dental.allergies"
_description = "Dental Allergies"

name = fields.Char(string='Name')
11 changes: 11 additions & 0 deletions dental/models/dental_chronic_conditions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import api, models, fields


class DentalChronicConditions(models.Model):

_name = "dental.chronic.conditions"
_description = "Dental Chronic Conditions"

name = fields.Char(string='Name')
sequence = fields.Integer('Sequence')
parent_id = fields.Many2one('dental.chronic.conditions')
9 changes: 9 additions & 0 deletions dental/models/dental_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import api, models, fields


class DentalConfiguration(models.Model):

_name = "dental.configuration"
_description = "Dental Configuration"

name = fields.Char(string='Name')
9 changes: 9 additions & 0 deletions dental/models/dental_habits.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import api, models, fields


class DentalHabits(models.Model):

_name = "dental.habits"
_description = "Dental Habits"

name = fields.Char(string='Name')
18 changes: 18 additions & 0 deletions dental/models/dental_medical_aids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from odoo import api, models, fields


class DentalMedicalAids(models.Model):

_name = "dental.medical.aids"
_description = "Medical Aids"

name = fields.Char(string='Name')
contact_id = fields.Many2one('res.partner', string='Contact')
phone_number = fields.Char(string='Phone')
email = fields.Char(string='Email')
company_id = fields.Many2one('res.company', string='Company')
notes = fields.Text(string='Notes')
image = fields.Image("Image")

state = fields.Selection(string='Status', default='new',
selection=[('new', 'New'), ('in progress', 'In Progress'), ('done', 'Done'),])
9 changes: 9 additions & 0 deletions dental/models/dental_medical_symptoms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import api, models, fields


class DentalMedicalSymptoms(models.Model):

_name = "dental.medical.symptoms"
_description = "Dental Medical Symptoms"

name = fields.Char(string='Name')
10 changes: 10 additions & 0 deletions dental/models/dental_medication.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import api, models, fields


class DentalMedication(models.Model):

_name = "dental.medication"
_description = "Dental Medication"

name = fields.Char(string='Name')
sequence = fields.Integer('Sequence')
34 changes: 34 additions & 0 deletions dental/models/dental_patient.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from odoo import api, models, fields


class DentalPatient(models.Model):

_name = "dental.patient"
_description = "Dental Patient"

name = fields.Char(string="Name")
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.condition', string="Chronic Conditions")
medication = fields.Many2many('dental.medication', string="Medication")
hospitalized_this_year = fields.Boolean(string="Hospitalised this Year")
allergies = fields.Char(string="Allergies")
notes = fields.Text(string='Notes')
habits_substance_abuse = fields.Char(string="Habits/Substance Abuse")
under_specialist_care = fields.Char(string="Under Specialist Care")
psychiatric_history = fields.Char(string="Psychiatric History")
female = fields.Boolean(string="Female")
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_aid = fields.Many2one('dental.medical.aids', string="Medical Aid")
medical_aid_plan = fields.Char(string='Medical Aid Plan')
medical_aid_number = fields.Integer(string='Medical Aid Number')
main_member_code = fields.Integer(string='Medical Member Code')
dependent_code = fields.Integer(string='Dependent Code')
13 changes: 13 additions & 0 deletions dental/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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_medical_symptoms,access_dental_medical_symptoms,model_dental_medical_symptoms,base.group_user,1,1,1,1
access_dental_medication,access_dental_medication,model_dental_medication,base.group_user,1,1,1,1
access_dental_configuration,access_dental_configuration,model_dental_configuration,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_habits,access_dental_habits,model_dental_habits,base.group_user,1,1,1,1




33 changes: 33 additions & 0 deletions dental/views/dental_allergies_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<odoo>
<record id="dental_allergies_action" model="ir.actions.act_window">
<field name="name">Allergies</field>
<field name="res_model">dental.allergies</field>
<field name="view_mode">tree,form</field>
</record>

<record id="dental_allergies_tree_view" model="ir.ui.view">
<field name="name">dental.allergies.tree</field>
<field name="model">dental.allergies</field>
<field name="arch" type="xml">
<tree string="Channel">
<field name="name" />
</tree>
</field>
</record>

<record id="dental_allergies_form" model="ir.ui.view">
<field name="name">dental.allergies.form</field>
<field name="model">dental.allergies</field>
<field name="arch" type="xml">
<form string="Dental Allergies">
<sheet>
<group>
<group>
<field name="name" />
</group>
</group>
</sheet>
</form>
</field>
</record>
</odoo>
38 changes: 38 additions & 0 deletions dental/views/dental_chronic_conditions_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<odoo>
<!-- Action -->
<record id="dental_chronic_condition_action" model="ir.actions.act_window">
<field name="name">Chronic Conditions</field>
<field name="res_model">dental.chronic.conditions</field>
<field name="view_mode">tree,form</field>
</record>

<record id="dental_chronic_conditions_tree_view" model="ir.ui.view">
<field name="name">dental.chronic.conditions.tree</field>
<field name="model">dental.chronic.conditions</field>
<field name="arch" type="xml">
<tree string="Channel">
<field name="sequence" widget="handle" />
<field name="name" />
</tree>
</field>
</record>

<record id="dental_chronic_conditions_form" model="ir.ui.view">
<field name="name">dental.chronic.conditions.form</field>
<field name="model">dental.chronic.conditions</field>
<field name="arch" type="xml">
<form string="Dental Chronic Conditions">
<sheet>
<group>
<group>
<field name="name" />
</group>
</group>
<div>
<field name="parent_id" />
</div>
</sheet>
</form>
</field>
</record>
</odoo>
33 changes: 33 additions & 0 deletions dental/views/dental_configuration_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<odoo>
<record id="dental_configuration_view" model="ir.actions.act_window">
<field name="name">Configuration</field>
<field name="res_model">dental.configuration</field>
<field name="view_mode">tree,form</field>
</record>

<record id="dental_configuration_tree_view" model="ir.ui.view">
<field name="name">dental.configuration.tree</field>
<field name="model">dental.configuration</field>
<field name="arch" type="xml">
<tree string="Channel">
<field name="name" />
</tree>
</field>
</record>

<record id="dental_configuration_form" model="ir.ui.view">
<field name="name">dental.configuration.form</field>
<field name="model">dental.configuration</field>
<field name="arch" type="xml">
<form string="Dental Configuration">
<sheet>
<group>
<group>
<field name="name" />
</group>
</group>
</sheet>
</form>
</field>
</record>
</odoo>
34 changes: 34 additions & 0 deletions dental/views/dental_habits_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<odoo>
<!-- Action -->
<record id="dental_habits_action" model="ir.actions.act_window">
<field name="name">Habits</field>
<field name="res_model">dental.habits</field>
<field name="view_mode">tree,form</field>
</record>

<record id="dental_habits_tree_view" model="ir.ui.view">
<field name="name">dental.habits.tree</field>
<field name="model">dental.habits</field>
<field name="arch" type="xml">
<tree string="Channel">
<field name="name" />
</tree>
</field>
</record>

<record id="dental_habits_form" model="ir.ui.view">
<field name="name">dental.habits.form</field>
<field name="model">dental.habits</field>
<field name="arch" type="xml">
<form string="Dental Habits">
<sheet>
<group>
<group>
<field name="name" />
</group>
</group>
</sheet>
</form>
</field>
</record>
</odoo>
62 changes: 62 additions & 0 deletions dental/views/dental_medical_aids_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<odoo>
<!-- Action -->
<record id="dental_medical_aids_action" 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="dental_medical_aids_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="Channel">
<field name="name" />
</tree>
</field>
</record>


<record id="dental_medical_aids_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="Dental Medical Aids">
<header>
<field name="state" widget="statusbar"
statusbar_visible="new,in progress,done" />
</header>
<sheet>
<field name="image" widget='image' class="oe_avatar" />
<h1>
<field name="name" />
</h1>
<group>
<group>
<field name="contact_id" />
<field name="phone_number" />
<field name="email" />
</group>
<group>
<field name="company_id" />
</group>
</group>
<div>
<field name="notes" placeholder="Type down your notes here" />
</div>
</sheet>
</form>
</field>
</record>


<record id="dental_medical_aids_search" model="ir.ui.view">
<field name="name">dental.medical.aids.search</field>
<field name="model">dental.medical.aids</field>
<field name="arch" type="xml">
<search string="Dental Medical Aids">
<field name="name" />
</search>
</field>
</record>
</odoo>
Loading

0 comments on commit 19ec879

Please sign in to comment.