@ -0,0 +1,53 @@ |
|||
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
|||
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
Legal Case Management |
|||
===================== |
|||
This module helps to manage all process of a legal case management firm. |
|||
In this way we can register a case and add their evidence, trial and payment also. |
|||
Assign the lawyers based on the wages and per case |
|||
|
|||
Configuration |
|||
============= |
|||
The user should be added to the security group: Admin(Settings/Users/Other/Case Management) inorder to get access to the new menu. |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (LGPL v3). |
|||
(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) |
|||
|
|||
Credits |
|||
------- |
|||
Developer: V16 LAJINA K V |
|||
V16 MOHAMMED DILSHAD TK |
|||
V17 Gayathri V |
|||
V18 Safa Faheem PE |
|||
V18 Gayathri V |
|||
Contact : odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import controllers |
|||
from . import models |
|||
from . import report |
|||
from . import wizard |
@ -0,0 +1,74 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
{ |
|||
'name': "Legal Case Management", |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Services', |
|||
'summary': """Legal Case Management for odoo 18. This module will helps |
|||
to manage a legal case management firm. This will allows to manage all |
|||
details of case sucha as evidence, trial and overall payment of a case""", |
|||
'description': """This module helps to manage all process of a legal case |
|||
management firm.In this way we can register a case and add their |
|||
evidence, trial and payment also. Assign the lawyers based on the wages |
|||
and per case""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['base', 'hr', 'contacts', 'account', 'website', 'mail'], |
|||
'data': [ |
|||
'data/case_register_menu.xml', |
|||
'data/ir_sequence_data.xml', |
|||
'security/legal_case_management_groups.xml', |
|||
'security/legal_case_management_security.xml', |
|||
'security/ir.model.access.csv', |
|||
'report/legal_evidence_reports.xml', |
|||
'report/legal_evidence_templates.xml', |
|||
'report/legal_trial_reports.xml', |
|||
'report/report_legal_case_management_report_legal_case_details_templates.xml', |
|||
'report/report_legal_case_management_report_case_register_document_templates.xml', |
|||
'report/legal_evidence_templates.xml', |
|||
'report/report_legal_case_management_report_case_trial_document_templates.xml', |
|||
'report/legal_case_reports.xml', |
|||
'report/case_registration_reports.xml', |
|||
'views/legal_case_management_menus.xml', |
|||
'views/case_registration_views.xml', |
|||
'views/hr_employee_views.xml', |
|||
'views/res_partner_views.xml', |
|||
'views/legal_evidence_views.xml', |
|||
'views/legal_trial_views.xml', |
|||
'views/legal_court_views.xml', |
|||
'views/case_category_views.xml', |
|||
'views/case_register_portal_template.xml', |
|||
'views/case_register_template.xml', |
|||
'views/account_move_views.xml', |
|||
'views/thanks_template.xml', |
|||
'views/legal_case_page_template.xml', |
|||
'wizard/invoice_payment_views.xml', |
|||
'wizard/full_settlement_views.xml', |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': True |
|||
} |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import legal_case_management |
|||
from . import portal |
@ -0,0 +1,55 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
import base64 |
|||
from odoo import http |
|||
from odoo.http import request |
|||
|
|||
|
|||
class LegalCaseController(http.Controller): |
|||
"""Legal Case Controller""" |
|||
@http.route('/legal/case/register', type="http", auth="user", website=True) |
|||
def legal_case_register(self): |
|||
""" Returns Case Registration Form""" |
|||
return request.render( |
|||
'legal_case_management.legal_case_register_view') |
|||
|
|||
@http.route('/submit/create/case', type='http', website=True, auth='user') |
|||
def create_case_register(self, **kw): |
|||
"""Creation of Cases""" |
|||
attached_files = request.httprequest.files.getlist('attachments') |
|||
case = request.env['case.registration'].sudo().create({ |
|||
'client_id': request.env.user.partner_id.id, |
|||
'email': request.env.user.partner_id.email, |
|||
'contact_no': kw['contact'], |
|||
'description': kw['description'], |
|||
'case_category_id': int(kw['case_category']), |
|||
'company_id': request.env.company.id, |
|||
}) |
|||
for attachment in attached_files: |
|||
request.env['ir.attachment'].sudo().create({ |
|||
'name': attachment.filename, |
|||
'res_model': 'case.registration', |
|||
'res_id': case.id, |
|||
'type': 'binary', |
|||
'datas': base64.b64encode(attachment.read()) |
|||
}) |
|||
return request.render("legal_case_management.thanks_page") |
@ -0,0 +1,73 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo.addons.portal.controllers.portal import CustomerPortal |
|||
from odoo import http |
|||
from odoo.http import request |
|||
|
|||
|
|||
class PortalLegalCase(CustomerPortal): |
|||
"""Customer Portal""" |
|||
def _prepare_home_portal_values(self, counters): |
|||
"""Returns the portal values""" |
|||
values = super()._prepare_home_portal_values(counters) |
|||
if 'case_count' in counters: |
|||
values['case_count'] = request.env[ |
|||
'case.registration'].sudo().search_count( |
|||
[('state', '!=', 'invoiced'), |
|||
('client_id.id', '=', request.env.user.partner_id.id)]) \ |
|||
if request.env['case.registration'].sudo(). \ |
|||
check_access_rights('read', raise_exception=False) else 0 |
|||
return values |
|||
|
|||
@http.route('/my/legal/case', |
|||
type='http', auth="user", website=True) |
|||
def legal_cases(self): |
|||
"""Returns the case Records""" |
|||
records = request.env['case.registration'].sudo(). \ |
|||
search([('client_id', '=', request.env.user.partner_id.id)]) |
|||
values = { |
|||
'records': records, |
|||
'page_name': 'case' |
|||
} |
|||
return request.render( |
|||
"legal_case_management.portal_my_legal_case_requests", |
|||
values) |
|||
|
|||
@http.route(['/my/cases/<int:case_id>'], type='http', auth="public", |
|||
website=True) |
|||
def portal_my_details_detail(self, case_id): |
|||
""" Returns the Portal details""" |
|||
case_record = request.env['case.registration'].sudo().browse(case_id) |
|||
evidences = request.env['legal.evidence'].sudo().search( |
|||
[('client_id', '=', case_record.client_id.id), |
|||
('case_id', '=', case_record.id)]) |
|||
trials = request.env['legal.trial'].sudo().search( |
|||
[('client_id', '=', case_record.client_id.id), |
|||
('case_id', '=', case_record.id)]) |
|||
records = { |
|||
'case_record': case_record, |
|||
'evidence': evidences, |
|||
'trial': trials, |
|||
'page_name': 'case' |
|||
} |
|||
return request.render("legal_case_management.portal_legal_case_page", |
|||
records) |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- Website Menu For Case Registration--> |
|||
<record id="menu_case_register" model="website.menu"> |
|||
<field name="name">Legal Case</field> |
|||
<field name="url">/legal/case/register</field> |
|||
<field name="parent_id" ref="website.main_menu"/> |
|||
<field name="sequence" type="int">30</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
|
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<!-- Generate Sequence Numbers For Case Registration, Evidence And Trial--> |
|||
<data noupdate="1"> |
|||
<record id="sequence_case_registration" model="ir.sequence"> |
|||
<field name="name">Case Sequence</field> |
|||
<field name="code">case_registration</field> |
|||
<field name="prefix">CASE000</field> |
|||
<field name="company_id" eval="False"/> |
|||
</record> |
|||
<record id="sequence_case_evidence" model="ir.sequence"> |
|||
<field name="name">Case Evidence Sequence</field> |
|||
<field name="code">case_evidence</field> |
|||
<field name="prefix">EV000</field> |
|||
<field name="company_id" eval="False"/> |
|||
</record> |
|||
<record id="sequence_legal_trial" model="ir.sequence"> |
|||
<field name="name">Legal Case Sequence</field> |
|||
<field name="code">legal_trial</field> |
|||
<field name="prefix">TR000</field> |
|||
<field name="company_id" eval="False"/> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
|
@ -0,0 +1,7 @@ |
|||
## Module <legal_case_management> |
|||
|
|||
#### 28.02.2025 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
|
|||
- Initial commit for Legal Case Management |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import account_move |
|||
from . import case_category |
|||
from . import case_registration |
|||
from . import case_sitting |
|||
from . import case_victim |
|||
from . import hr_employee |
|||
from . import legal_court |
|||
from . import legal_evidence |
|||
from . import legal_trial |
|||
from . import res_partner |
@ -0,0 +1,30 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AccountMove(models.Model): |
|||
"""Inherit account move""" |
|||
_inherit = 'account.move' |
|||
|
|||
case_ref = fields.Char(readonly=True, string='Case Reference', |
|||
help='It is used to identify the case reference') |
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class CaseCategory(models.Model): |
|||
"""Create case category""" |
|||
_name = 'case.category' |
|||
_description = 'Case Category' |
|||
|
|||
name = fields.Char("Case Category", required=True, |
|||
help='Name of the case category') |
|||
|
|||
@api.ondelete(at_uninstall=False) |
|||
def _unlink_except_draft_or_cancel(self): |
|||
""" Prevent the deletion of a case category if it is used in any |
|||
cases. """ |
|||
cases = self.sudo().env['case.registration'].search_count([ |
|||
('case_category_id', 'in', self.ids), |
|||
('state', 'not in', ['draft']) |
|||
]) |
|||
if cases: |
|||
raise UserError(_("You can not delete a case category," |
|||
" because it is used in case")) |
@ -0,0 +1,332 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import UserError, ValidationError |
|||
|
|||
|
|||
class CaseRegistration(models.Model): |
|||
"""Case registration and invoice for trials and case""" |
|||
_name = 'case.registration' |
|||
_inherit = ['mail.thread', 'mail.activity.mixin'] |
|||
_description = 'Case Register' |
|||
|
|||
name = fields.Char(string='Case No', readonly=True, |
|||
default=lambda self: _('New'), |
|||
copy=False, |
|||
help='Case number') |
|||
client_id = fields.Many2one('res.partner', string='Client', required=True, |
|||
help='Clients in the law firm') |
|||
email = fields.Char(related="client_id.email", required=True, |
|||
string='Email', |
|||
help='Email of client', readonly=False) |
|||
contact_no = fields.Char(related="client_id.phone", required=True, |
|||
string='Contact No', readonly=False, |
|||
help='Contact number') |
|||
payment_method = fields.Selection(selection=[ |
|||
('trial', "Per Trial"), |
|||
('case', "Per Case"), |
|||
('out_of_court', "Out of Court")], string='Payment Method', |
|||
states={'draft': [('invisible', True)]}, |
|||
help="Payment method to select one method") |
|||
lawyer_wage = fields.Char(string="Lawyer Wage", help="wage of the lawyers", |
|||
invisible=True) |
|||
lawyer_id = fields.Many2one('hr.employee', string='Lawyer', |
|||
domain=[('is_lawyer', '=', True)], |
|||
help="Lawyers in the law firm") |
|||
lawyer_unavailable = fields.Boolean(string="Is Unavailable", |
|||
help="Which is used to identify the " |
|||
"available lawyers", |
|||
default=False) |
|||
junior_lawyer_id = fields.Many2one('hr.employee', string='Junior Lawyer', |
|||
help='Juniors lawyers in the law firm') |
|||
court_id = fields.Many2one('legal.court', string='Court', |
|||
help="Name of courts") |
|||
court_no_required = fields.Boolean(string="Is Court Number Required", |
|||
help='Makes court as Not required field', |
|||
default=True) |
|||
judge_id = fields.Many2one(related='court_id.judge_id', string='Judge', |
|||
store=True, help="Available judges") |
|||
register_date = fields.Date(string='Registration Date', required=True, |
|||
default=fields.Date.today, |
|||
help='Case registration date') |
|||
start_date = fields.Date(string='Start Date', default=fields.Date.today) |
|||
end_date = fields.Date(string='End Date') |
|||
case_category_id = fields.Many2one('case.category', string='Case Category', |
|||
required=True, |
|||
help="Category of case") |
|||
description = fields.Html(string='Description', required=True, |
|||
help="Case Details") |
|||
opposition_name = fields.Char(string='Name', help="Name of Opposite Party") |
|||
opposite_lawyer = fields.Char(string='Lawyer', help="Name of opposite " |
|||
"Lawyer") |
|||
opp_party_contact = fields.Char(string='Contact No', |
|||
hel='Contact No for opposite party') |
|||
victim_ids = fields.One2many('case.victim', 'registration_id', |
|||
help="List of Victims") |
|||
sitting_detail_ids = fields.One2many('case.sitting', 'case_id') |
|||
evidence_count = fields.Integer(string="Evidence Count", |
|||
compute='_compute_evidence_count', |
|||
help="Count of evidence") |
|||
case_attachment_count = fields.Integer(string="Case Attachment Count", |
|||
compute='_compute_case_attachment_count', |
|||
help="Count of attachments") |
|||
trial_count = fields.Integer(string="Trial Count", |
|||
compute='_compute_trial_count', |
|||
help="Count of trials") |
|||
invoice_count = fields.Integer(string="Invoice Count", |
|||
compute='_compute_invoice_count', |
|||
help="Count of Invoices") |
|||
state = fields.Selection( |
|||
[('draft', 'Draft'), ('in_progress', 'In Progress'), |
|||
('invoiced', 'Invoiced'), ('reject', 'Reject'), |
|||
('won', 'Won'), ('lost', 'Lost'), ('cancel', 'Cancel')], |
|||
string='State', default='draft', help="State of case") |
|||
company_id = fields.Many2one("res.company", string="Company", |
|||
default=lambda self: self.env.company, |
|||
readonly=True, |
|||
help="Company in which the case done") |
|||
|
|||
@api.onchange('payment_method') |
|||
def _onchange_payment_method(self): |
|||
"""Court not required based on, |
|||
- if payment method = out of court |
|||
- if invoice through full settlement""" |
|||
if self.payment_method == 'out_of_court': |
|||
self.court_no_required = False |
|||
else: |
|||
self.court_no_required = True |
|||
|
|||
@api.onchange('lawyer_id') |
|||
def _onchange_lawyer_id(self): |
|||
"""Lawyer unavailable warning and lists his juniors""" |
|||
cases = self.sudo().search( |
|||
[('lawyer_id', '=', self.lawyer_id.id), ('state', '!=', 'draft'), |
|||
('id', '!=', self._origin.id)]) |
|||
self.lawyer_id.not_available = False |
|||
self.lawyer_unavailable = False |
|||
if self.lawyer_id: |
|||
for case in cases: |
|||
if case.end_date and case.end_date <= fields.Date.today(): |
|||
self.lawyer_id.not_available = False |
|||
self.lawyer_unavailable = False |
|||
else: |
|||
self.lawyer_id.not_available = True |
|||
self.lawyer_unavailable = True |
|||
break |
|||
if self.lawyer_unavailable: |
|||
return { |
|||
'warning': { |
|||
'title': 'Lawyer Unavailable', |
|||
'message': 'The selected lawyer is unavailable ' |
|||
'at this time.' |
|||
'You can choose his juniors.', |
|||
}, |
|||
'domain': { |
|||
'junior_lawyer_id': [('parent_id', '=', |
|||
self.lawyer_id.id), |
|||
('is_lawyer', '=', True)], |
|||
}, |
|||
} |
|||
|
|||
@api.ondelete(at_uninstall=False) |
|||
def _unlink_except_draft_or_cancel(self): |
|||
""" Records can be deleted only draft and cancel state""" |
|||
case_records = self.filtered( |
|||
lambda x: x.state not in ['draft', 'cancel']) |
|||
if case_records: |
|||
raise UserError(_( |
|||
"You can not delete a Approved Case." |
|||
" You must first cancel it.")) |
|||
|
|||
def action_full_settlement(self): |
|||
"""Returns the full settlement view""" |
|||
self.court_no_required = False |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'res_model': 'full.settlement', |
|||
'view_mode': 'form', |
|||
'target': 'new', |
|||
'context': {'default_case_id': self.id} |
|||
} |
|||
|
|||
def action_cancel(self): |
|||
"""State changed to cancel""" |
|||
self.write({'state': 'cancel'}) |
|||
self.lawyer_id.not_available = False |
|||
self.end_date = fields.Date.today() |
|||
|
|||
def action_reset_to_draft(self): |
|||
""" Stage reset to draft""" |
|||
self.write({'state': 'draft'}) |
|||
|
|||
def action_confirm(self): |
|||
"""Confirmation of Cases""" |
|||
if self.name == 'New': |
|||
self.name = self.env['ir.sequence']. \ |
|||
next_by_code('case_registration') or 'New' |
|||
self.state = 'in_progress' |
|||
|
|||
def action_reject(self): |
|||
"""Rejection of Cases""" |
|||
self.write({'state': 'reject'}) |
|||
|
|||
def validation_case_registration(self): |
|||
"""Show Validation Until The Lawyer Details are Filled""" |
|||
if not self.lawyer_id: |
|||
raise ValidationError(_( |
|||
"""Please assign a lawyer for the case""" |
|||
)) |
|||
|
|||
def action_invoice(self): |
|||
"""Button method to show invoice wizard""" |
|||
if not self.payment_method: |
|||
raise ValidationError(_( |
|||
"""Please select a payment method for create invoice""" |
|||
)) |
|||
if self.payment_method == 'case': |
|||
self.lawyer_wage = self.lawyer_id.wage_per_case |
|||
elif self.payment_method == 'trial': |
|||
self.lawyer_wage = self.lawyer_id.wage_per_trial |
|||
else: |
|||
self.lawyer_wage = '' |
|||
self.validation_case_registration() |
|||
return { |
|||
'name': 'Create Invoice', |
|||
'type': 'ir.actions.act_window', |
|||
'res_model': 'invoice.payment', |
|||
'view_mode': 'form', |
|||
'target': 'new', |
|||
'context': {'default_case_id': self.id, |
|||
'default_cost': self.lawyer_wage} |
|||
} |
|||
|
|||
def action_evidence(self): |
|||
"""Button to add evidence""" |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Evidence', |
|||
'view_mode': 'form', |
|||
'res_model': 'legal.evidence', |
|||
'context': {'default_case_id': self.id, |
|||
'default_client_id': self.client_id.id} |
|||
} |
|||
|
|||
def get_attachments(self): |
|||
"""Show attachments in smart tab which added in chatter""" |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Attachment', |
|||
'view_mode': 'kanban,form', |
|||
'res_model': 'ir.attachment', |
|||
'domain': [('res_id', '=', self.id), |
|||
('res_model', '=', self._name)], |
|||
'context': {'create': False} |
|||
} |
|||
|
|||
def _compute_case_attachment_count(self): |
|||
"""Compute the count of attachments""" |
|||
for attachment in self: |
|||
attachment.case_attachment_count = self.env['ir.attachment']. \ |
|||
sudo().search_count([('res_id', '=', self.id), |
|||
('res_model', '=', self._name)]) |
|||
|
|||
def action_won(self): |
|||
"""Changed to won state""" |
|||
self.state = 'won' |
|||
self.end_date = fields.Date.today() |
|||
self.lawyer_id.not_available = False |
|||
|
|||
def action_lost(self): |
|||
"""Changed to lost state""" |
|||
self.state = 'lost' |
|||
self.end_date = fields.Date.today() |
|||
self.lawyer_id.not_available = False |
|||
|
|||
def _compute_evidence_count(self): |
|||
"""Computes the count of evidence""" |
|||
for case in self: |
|||
case.evidence_count = case.env['legal.evidence'].search_count( |
|||
[('client_id', '=', self.client_id.id), |
|||
('case_id', '=', self.id)]) |
|||
|
|||
def _compute_trial_count(self): |
|||
"""Compute the count of trials""" |
|||
for case in self: |
|||
case.trial_count = case.env['legal.trial']. \ |
|||
search_count([('client_id', '=', self.client_id.id), |
|||
('case_id', '=', self.id)]) |
|||
|
|||
def action_trial(self): |
|||
"""Button to add trial""" |
|||
self.validation_case_registration() |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Trial', |
|||
'view_mode': 'form', |
|||
'res_model': 'legal.trial', |
|||
'context': {'default_case_id': self.id, |
|||
'default_client_id': self.client_id.id} |
|||
} |
|||
|
|||
def _compute_invoice_count(self): |
|||
"""Calculate the count of invoices""" |
|||
for inv in self: |
|||
inv.invoice_count = self.env['account.move'].search_count( |
|||
[('case_ref', '=', self.name)]) |
|||
|
|||
def get_invoice(self): |
|||
"""Get the corresponding invoices""" |
|||
return { |
|||
'name': 'Case Invoice', |
|||
'type': 'ir.actions.act_window', |
|||
'view_mode': 'list,form', |
|||
'res_model': 'account.move', |
|||
'domain': [('case_ref', '=', self.name)], |
|||
} |
|||
|
|||
def get_evidence(self): |
|||
"""Returns the evidences""" |
|||
evidence_ids_list = self.env['legal.evidence']. \ |
|||
search([('client_id', '=', self.client_id.id), |
|||
('case_id', '=', self.id)]).ids |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Evidence', |
|||
'view_mode': 'list,form', |
|||
'res_model': 'legal.evidence', |
|||
'domain': [('id', 'in', evidence_ids_list)], |
|||
'context': "{'create': False}" |
|||
} |
|||
|
|||
def get_trial(self): |
|||
"""Returns the Trials""" |
|||
trial_ids_list = self.env['legal.trial']. \ |
|||
search([('client_id', '=', self.client_id.id), |
|||
('case_id', '=', self.id)]).ids |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Trial', |
|||
'view_mode': 'list,form', |
|||
'res_model': 'legal.trial', |
|||
'domain': [('id', 'in', trial_ids_list)], |
|||
'context': "{'create': False}" |
|||
} |
@ -0,0 +1,36 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class CaseSitting(models.Model): |
|||
"""Create case sitting""" |
|||
_name = 'case.sitting' |
|||
_description = 'Case Sitting"' |
|||
|
|||
date = fields.Date(string='Date', help='Date of case sitting', required=True) |
|||
details = fields.Text(string='Details', help='Details of sittings') |
|||
contact = fields.Char(string='Contact', help="Name of contact person") |
|||
done = fields.Boolean(string='Done', help="Is the sitting is completed or " |
|||
"not") |
|||
case_id = fields.Many2one('case.registration', string='Connecting Field', |
|||
help="case related to the sitting") |
@ -0,0 +1,34 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class CaseVictim(models.Model): |
|||
"""Create victim""" |
|||
_name = 'case.victim' |
|||
_description = 'Case Victim' |
|||
|
|||
name = fields.Char(string='Name', help='Victim Name', required=True) |
|||
contact = fields.Char(string='Contact No', help='Contact of Case victim') |
|||
registration_id = fields.Many2one('case.registration', |
|||
string='Registration', |
|||
help="Victim registration") |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class HrEmployee(models.Model): |
|||
"""To create lawyers""" |
|||
_inherit = 'hr.employee' |
|||
|
|||
is_lawyer = fields.Boolean(string="Is Lawyer", |
|||
help='Is this employee is a lawyer') |
|||
wage_per_trial = fields.Integer(string="Wage Per Trial", |
|||
help='Wage per trial') |
|||
wage_per_case = fields.Integer(string="Wage Per Case", help='Wage per Case') |
|||
not_available = fields.Boolean(string='Not Available', |
|||
help='Lawyer Unavailable') |
@ -0,0 +1,53 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class LegalCourt(models.Model): |
|||
"""Creation of legal court""" |
|||
_name = 'legal.court' |
|||
_description = 'legal court' |
|||
|
|||
name = fields.Char("Name", required=True, help='Name') |
|||
judge_id = fields.Many2one('res.partner', |
|||
domain="[('is_judge', '=', True)," |
|||
"('is_judge_unavailable', '=',False)]", |
|||
string='Judge', |
|||
help='Judges are available in the court') |
|||
|
|||
@api.onchange('judge_id') |
|||
def _onchange_judge_id(self): |
|||
"""This is used to Get judges""" |
|||
self.judge_id.is_judge = True |
|||
self.judge_id.is_judge_unavailable = True |
|||
|
|||
@api.ondelete(at_uninstall=False) |
|||
def _unlink_except_draft_or_cancel(self): |
|||
""" Prevent the deletion of a court if it is used in any cases. """ |
|||
cases = self.sudo().env['case.registration'].search_count([ |
|||
('court_id', 'in', self.ids), |
|||
('state', 'not in', ['draft']) |
|||
]) |
|||
if cases: |
|||
raise UserError(_("You can not delete a court, " |
|||
"because it is used in case")) |
@ -0,0 +1,81 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class LegalEvidence(models.Model): |
|||
"""Creation of legal evidence""" |
|||
_name = 'legal.evidence' |
|||
_description = 'legal evidence' |
|||
_inherit = ['mail.thread', 'mail.activity.mixin'] |
|||
|
|||
name = fields.Char(string='Reference', copy=False, readonly=True, |
|||
default=lambda x: _('New'), |
|||
help='Reference for the legal evidence') |
|||
case_id = fields.Many2one("case.registration", string="Case", |
|||
help='Name for cases', |
|||
required=True, |
|||
domain="[('state', 'not in'," |
|||
"['won', 'lost','invoiced'])]") |
|||
in_favor_id = fields.Many2one("res.partner", string="In Favor", |
|||
help=' Name of in favor for the evidence', |
|||
required=True) |
|||
client_id = fields.Many2one(related="case_id.client_id", string="Client", |
|||
help='Clients for the evidence') |
|||
description = fields.Text(string="Description", |
|||
help='Description of evidence') |
|||
attachment_count = fields.Integer(string="Attachment Count", |
|||
compute='_compute_attachment_count', |
|||
help="Count of attachments") |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
"""Generate Sequence For Evidence""" |
|||
if vals.get('name', 'New') == 'New': |
|||
vals['name'] = self.env['ir.sequence'].next_by_code( |
|||
'case_evidence') or 'New' |
|||
return super().create(vals) |
|||
|
|||
@api.ondelete(at_uninstall=False) |
|||
def _unlink_except_draft_or_cancel(self): |
|||
""" Records can't be deleted""" |
|||
raise UserError(_("You can not delete a evidence")) |
|||
|
|||
def get_evidence_attachments(self): |
|||
"""Get the corresponding attachments of evidence""" |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Attachments', |
|||
'view_mode': 'kanban,form', |
|||
'res_model': 'ir.attachment', |
|||
'domain': [('res_id', '=', self.id), |
|||
('res_model', '=', self._name)], |
|||
'context': "{'create': False}" |
|||
} |
|||
|
|||
def _compute_attachment_count(self): |
|||
"""Compute the count of attachments""" |
|||
for attachment in self: |
|||
attachment.attachment_count = self.env['ir.attachment']. \ |
|||
sudo().search_count([('res_id', '=', self.id), |
|||
('res_model', '=', self._name)]) |
@ -0,0 +1,66 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class LegalTrial(models.Model): |
|||
"""This is used to the creation of legal trial""" |
|||
_name = 'legal.trial' |
|||
_inherit = ['mail.thread', 'mail.activity.mixin'] |
|||
_description = 'Legal Trial' |
|||
|
|||
name = fields.Char(string="Name", readonly=True, default=lambda self: _('New'), |
|||
help='Trial number') |
|||
case_id = fields.Many2one('case.registration', string="Case", |
|||
help='Corresponding case', |
|||
required=True, |
|||
domain="[('state', 'not in'," |
|||
"['won', 'lost', 'invoiced'])]") |
|||
client_id = fields.Many2one(related="case_id.client_id", string="Client", |
|||
readonly=False, required=True, |
|||
help='Client of the legal trial') |
|||
trial_date = fields.Datetime(string="Trial Date", help='Date for trial', |
|||
required=True) |
|||
judge_id = fields.Many2one(related="case_id.judge_id", string="Judge", |
|||
readonly=False, help="Judge for " |
|||
"corresponding case") |
|||
court_id = fields.Many2one(related="case_id.court_id", string="Court", |
|||
readonly=False, help="Court for " |
|||
"corresponding case") |
|||
description = fields.Html(string="Description", |
|||
help="Description for the trail") |
|||
is_invoiced = fields.Boolean(string='Is invoiced', help="Is trial invoiced", |
|||
default=False) |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
"""Generate Sequence For Evidence""" |
|||
if vals.get('name', 'New') == 'New': |
|||
vals['name'] = self.env['ir.sequence'].next_by_code( |
|||
'legal_trial') or 'New' |
|||
return super().create(vals) |
|||
|
|||
@api.ondelete(at_uninstall=False) |
|||
def _unlink_except_draft_or_cancel(self): |
|||
""" Records can't be deleted""" |
|||
raise UserError(_("You can not delete a trial")) |
@ -0,0 +1,32 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResPartner(models.Model): |
|||
"""Inherit res partner""" |
|||
_inherit = 'res.partner' |
|||
|
|||
is_judge = fields.Boolean(string='Is Judge', help='Is he a Judge') |
|||
is_judge_unavailable = fields.Boolean(string="Judge Available?", |
|||
default=False, |
|||
help="Check the availability of judge") |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import report_legal_case_management_report_case_register_document_report |
|||
from . import report_legal_case_management_report_case_evidence_document_report |
|||
from . import report_legal_case_management_report_case_trial_document_report |
|||
from . import report_legal_case_management_report_legal_case_details_report |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<!-- Actions For Pdf Report--> |
|||
<record id="case_registration_action_report" model="ir.actions.report"> |
|||
<field name="name">Case Report</field> |
|||
<field name="model">case.registration</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">legal_case_management.report_case_register_documents</field> |
|||
<field name="report_file">legal_case_management.report_case_register_documents</field> |
|||
<field name="print_report_name">'Case Report '</field> |
|||
<field name="attachment"/> |
|||
<field name="binding_model_id" ref="model_case_registration"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Actions For Pdf Report--> |
|||
<record id="legal_case_wizard_action_report" model="ir.actions.report"> |
|||
<field name="name">Legal Case Report</field> |
|||
<field name="model">legal.case.report</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">legal_case_management.report_legal_case_details</field> |
|||
<field name="report_file">legal_case_management.report_legal_case_details</field> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Actions For Pdf Report--> |
|||
<record id="legal_evidence_action_report" model="ir.actions.report"> |
|||
<field name="name">Evidence Report</field> |
|||
<field name="model">legal.evidence</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">legal_case_management.report_case_evidence_document</field> |
|||
<field name="report_file">legal_case_management.report_case_evidence_document</field> |
|||
<field name="binding_model_id" ref="model_legal_evidence"/> |
|||
<field name="binding_type">report</field> |
|||
<field name="binding_view_types">form</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,50 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Report Template For Evidence For Case--> |
|||
<template id="report_case_evidence_document"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<div class="text-center"> |
|||
<h2>Case Evidence Report</h2> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<h2 class="mt-16"> |
|||
<span>Evidence #</span> |
|||
<span t-esc="evidence.name"/> |
|||
</h2> |
|||
<table class="table table-bordered" |
|||
style="table-layout: fixed;"> |
|||
<thead> |
|||
<tr style="font-size: 22px;font-weight:bold;"> |
|||
<th t-if="evidence.case_id.name">Case</th> |
|||
<th t-if="evidence.client_id.name">Client</th> |
|||
<th t-if="evidence.in_favor_id.name">In Favor</th> |
|||
<th t-if="evidence.description">Description</th> |
|||
<th t-if="evidence.case_id.state">State</th> |
|||
</tr> |
|||
</thead> |
|||
<tr style="font-size: 20px;"> |
|||
<td t-if="evidence.case_id.name"> |
|||
<span t-esc="evidence.case_id.name"/> |
|||
</td> |
|||
<td t-if="evidence.client_id.name"> |
|||
<span t-field="evidence.client_id.name"/> |
|||
</td> |
|||
<td t-if="evidence.in_favor_id.name"> |
|||
<span t-field="evidence.in_favor_id.name"/> |
|||
</td> |
|||
<td t-if="evidence.description"> |
|||
<span t-field="evidence.description"/> |
|||
</td> |
|||
<td t-if="evidence.case_id.state"> |
|||
<span t-field="evidence.case_id.state"/> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Actions For Pdf Report--> |
|||
<record id="legal_trial_action_report" model="ir.actions.report"> |
|||
<field name="name">Trial Report</field> |
|||
<field name="model">legal.trial</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">legal_case_management.report_case_trial_document</field> |
|||
<field name="report_file">legal_case_management.report_case_trial_document</field> |
|||
<field name="binding_model_id" ref="model_legal_trial"/> |
|||
<field name="binding_type">report</field> |
|||
<field name="binding_view_types">form</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import models |
|||
|
|||
|
|||
class ReportLegalCaseManagementReportCaseEvidenceDocument(models.AbstractModel): |
|||
"""This is used to get the Evidence report""" |
|||
_name = 'report.legal_case_management.report_case_evidence_document' |
|||
_description = "Report For Evidence" |
|||
|
|||
def _get_report_values(self, docids, data=None): |
|||
"""Return the Report Values For Evidence""" |
|||
evidence_record = self.env['legal.evidence'].browse(docids) |
|||
return { |
|||
'evidence': evidence_record |
|||
} |
@ -0,0 +1,43 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import models |
|||
|
|||
|
|||
class ReportLegalCaseManagementReportCaseRegisterDocument(models.AbstractModel): |
|||
"""Case registration report""" |
|||
_name = 'report.legal_case_management.report_case_register_documents' |
|||
_description = "Report For Case Registration" |
|||
|
|||
def _get_report_values(self, docids, data=None): |
|||
"""Return the Report Values""" |
|||
case_record = self.env['case.registration'].browse(docids) |
|||
evidences = self.env['legal.evidence']. \ |
|||
search([('client_id', '=', case_record.client_id.id), |
|||
('case_id', '=', case_record.id)]) |
|||
trials = self.env['legal.trial']. \ |
|||
search([('client_id', '=', case_record.client_id.id), |
|||
('case_id', '=', case_record.id)]) |
|||
return { |
|||
'case_record': case_record, |
|||
'evidence': evidences, |
|||
'trial': trials |
|||
} |
@ -0,0 +1,82 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Report Template For Case registration form --> |
|||
<template id="report_case_register_documents"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<div> |
|||
<t t-set="address"> |
|||
<span class="fw-bold">Client Details</span> |
|||
<br/> |
|||
<div t-field="case_record.client_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|||
<p t-if="case_record.client_id.vat"> |
|||
<t |
|||
t-out="case_record.company_id.account_fiscal_country_id.vat_label or 'Tax ID'"/> |
|||
: |
|||
<span t-field="case_record.client_id.vat"/> |
|||
</p> |
|||
</t> |
|||
</div> |
|||
<br/> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<div class="text-center"> |
|||
<h2>Legal Case Report</h2> |
|||
</div> |
|||
<h2 class="mt-16"> |
|||
<span>Case :</span> |
|||
<span t-field="case_record.name"/> |
|||
</h2> |
|||
<table class="table table-bordered" |
|||
style="table-layout: fixed;"> |
|||
<thead> |
|||
<tr style="font-size: 22px;font-weight:bold;"> |
|||
<th t-if="case_record.case_category_id">Case |
|||
Category |
|||
</th> |
|||
<th t-if="case_record.lawyer_id">Lawyer</th> |
|||
<th t-if="evidence">Evidence</th> |
|||
<th t-if="trial">Trial</th> |
|||
<th t-if="case_record.evidence_count">Evidence |
|||
Count |
|||
</th> |
|||
<th t-if="case_record.trial_count">Trial Count |
|||
</th> |
|||
<th t-if="case_record.state">State</th> |
|||
</tr> |
|||
</thead> |
|||
<tr style="font-size: 20px;"> |
|||
<td t-if="case_record.case_category_id"> |
|||
<span t-field="case_record.case_category_id"/> |
|||
</td> |
|||
<td t-if="case_record.lawyer_id"> |
|||
<span t-field="case_record.lawyer_id.name"/> |
|||
</td> |
|||
<td t-if="evidence"> |
|||
<t t-foreach="evidence" t-as="evidence"> |
|||
<span t-field="evidence.name"/> |
|||
</t> |
|||
</td> |
|||
<td t-if="trial"> |
|||
<t t-foreach="trial" t-as="trial"> |
|||
<span t-field="trial.name"/> |
|||
</t> |
|||
</td> |
|||
<td t-if="case_record.evidence_count"> |
|||
<span t-field="case_record.evidence_count"/> |
|||
</td> |
|||
<td t-if="case_record.trial_count"> |
|||
<span t-field="case_record.trial_count"/> |
|||
</td> |
|||
<td t-if="case_record.state"> |
|||
<t t-esc="dict (case_record.fields_get |
|||
(allfields = ['state']) ['state'] |
|||
['selection']) [case_record.state]"/> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import models |
|||
|
|||
|
|||
class ReportLegalCaseManagementReportCaseTrialDocument(models.AbstractModel): |
|||
"""This is used to get the Trial Report""" |
|||
_name = 'report.legal_case_management.report_case_trial_document' |
|||
_description = "Report For Trial" |
|||
|
|||
def _get_report_values(self, docids, data=None): |
|||
"""Return the Report Values""" |
|||
trial_record = self.env['legal.trial'].browse(docids) |
|||
return { |
|||
'trial': trial_record, |
|||
} |
@ -0,0 +1,47 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!--Template For Trials For Case --> |
|||
<template id="report_case_trial_document"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
|
|||
<div class="text-center"> |
|||
<h2>Case Trial Report</h2> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<h2 class="mt-16"> |
|||
<span>Trial #</span> |
|||
<span t-esc="trial.name"/> |
|||
</h2> |
|||
<table class="table table-bordered" |
|||
style="table-layout: fixed;"> |
|||
<thead> |
|||
<tr style="font-size: 22px;font-weight:bold;"> |
|||
<th t-if="trial.case_id.name">Case</th> |
|||
<th t-if="trial.client_id.name">Client</th> |
|||
<th t-if="trial.trial_date">Trial Date</th> |
|||
<th t-if="trial.case_id.state">State</th> |
|||
</tr> |
|||
</thead> |
|||
<tr style="font-size: 20px;"> |
|||
<td t-if="trial.case_id.name"> |
|||
<span t-esc="trial.case_id.name"/> |
|||
</td> |
|||
<td t-if="trial.client_id.name"> |
|||
<span t-field="trial.client_id.name"/> |
|||
</td> |
|||
<td t-if="trial.trial_date"> |
|||
<span t-field="trial.trial_date"/> |
|||
</td> |
|||
<td t-if="trial.case_id.state"> |
|||
<span t-field="trial.case_id.state"/> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,263 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Gayathri V (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import models |
|||
|
|||
|
|||
class ReportLegalCaseManagementReportLegalCaseDetails(models.AbstractModel): |
|||
"""Report of module""" |
|||
_name = 'report.legal_case_management.report_legal_case_details' |
|||
_description = "Report For Case Registration" |
|||
|
|||
def _get_report_values(self, docids, data=None): |
|||
"""This is used to Get data to the pdf""" |
|||
query = """select case_reg.name as case_name,case_reg.start_date as |
|||
start_date, case_reg.end_date as end_date, res_client.name as client, |
|||
lawyer.name as lawyer, court.name as court,res_judge.name as judge, |
|||
INITCAP(case_reg.payment_method) as payment_method, INITCAP( |
|||
case_reg.state) as state from case_registration case_reg LEFT JOIN |
|||
res_partner res_client ON case_reg.client_id = res_client.id LEFT |
|||
JOIN res_partner res_judge ON case_reg.judge_id= res_judge.id LEFT |
|||
JOIN hr_employee lawyer ON lawyer.id = case_reg.lawyer_id LEFT JOIN |
|||
legal_court court ON case_reg.court_id = court.id""" |
|||
if data['lawyer_id'] and data['client_id'] and data['court_id'] \ |
|||
and data['judge_id'] and data['start_date'] and data['end_date'] \ |
|||
and data['payment_method'] and data['state']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' |
|||
AND court.name ='%s' AND res_judge.name = '%s' AND |
|||
case_reg.start_date = '%s' AND case_reg.end_date = '%s' AND |
|||
case_reg.payment_method = '%s' AND case_reg.state = '%s' """ \ |
|||
% (data['lawyer_id'], data['client_id'], data['court_id'], |
|||
data['judge_id'], data['start_date'], data['end_date'], |
|||
data['payment_method'], data['state']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['court_id'] \ |
|||
and data['judge_id'] and data['start_date'] and \ |
|||
data['end_date'] and data['payment_method']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
court.name ='%s' AND res_judge.name = '%s' AND |
|||
case_reg.start_date = '%s' AND case_reg.end_date = '%s' |
|||
AND case_reg.payment_method = '%s' """ \ |
|||
% (data['lawyer_id'], data['client_id'], data['court_id'], |
|||
data['judge_id'], data['start_date'], data['end_date'], |
|||
data['payment_method']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['court_id'] \ |
|||
and data['judge_id'] and data['start_date'] and data['end_date']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
court.name ='%s' AND res_judge.name = '%s' AND |
|||
case_reg.start_date = '%s' AND |
|||
case_reg.end_date = '%s' """ % (data['lawyer_id'], |
|||
data['client_id'], |
|||
data['court_id'], |
|||
data['judge_id'], |
|||
data['start_date'], |
|||
data['end_date']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['court_id'] \ |
|||
and data['judge_id'] and data['start_date']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
court.name ='%s' AND res_judge.name = '%s' AND |
|||
case_reg.start_date = '%s'""" % (data['lawyer_id'], |
|||
data['client_id'], |
|||
data['court_id'], |
|||
data['judge_id'], |
|||
data['start_date']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['court_id'] \ |
|||
and data['judge_id']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
court.name ='%s' AND res_judge.name = '%s'""" \ |
|||
% (data['lawyer_id'], |
|||
data['client_id'], |
|||
data['court_id'], |
|||
data['judge_id']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['court_id']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
court.name ='%s'""" % (data['lawyer_id'], |
|||
data['client_id'], |
|||
data['court_id']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['judge_id']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
res_judge.name ='%s'""" % (data['lawyer_id'], |
|||
data['client_id'], |
|||
data['judge_id']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['start_date']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
case_reg.start_date ='%s'""" \ |
|||
% (data['lawyer_id'], data['client_id'], |
|||
data['start_date']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['end_date']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
case_reg.end_date ='%s'""" \ |
|||
% (data['lawyer_id'], data['client_id'], |
|||
data['start_date']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['payment_method']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
case_reg.payment_method ='%s'""" \ |
|||
% (data['lawyer_id'], data['client_id'], |
|||
data['payment_method']) |
|||
elif data['lawyer_id'] and data['client_id'] and data['state']: |
|||
query += f""" WHERE lawyer.name = '%s' AND res_client.name='%s' AND |
|||
case_reg.state ='%s'""" % (data['lawyer_id'], |
|||
data['client_id'], |
|||
data['state']) |
|||
elif data['lawyer_id'] and data['client_id']: |
|||
query += f""" WHERE lawyer.name ='%s' AND |
|||
res_client.name='%s'""" % (data['lawyer_id'], |
|||
data['client_id']) |
|||
elif data['lawyer_id'] and data['judge_id']: |
|||
query += f""" WHERE lawyer.name ='%s' AND |
|||
res_judge.name='%s'""" % (data['lawyer_id'], |
|||
data['judge_id']) |
|||
elif data['lawyer_id'] and data['court_id']: |
|||
query += f""" WHERE lawyer.name ='%s' AND |
|||
court.name='%s'""" % (data['lawyer_id'], |
|||
data['court_id']) |
|||
elif data['lawyer_id'] and data['start_date']: |
|||
query += f""" WHERE lawyer.name ='%s' AND |
|||
case_reg.start_date='%s'""" \ |
|||
% (data['lawyer_id'], data['start_date']) |
|||
elif data['lawyer_id'] and data['end_date']: |
|||
query += f""" WHERE lawyer.name ='%s' AND |
|||
case_reg.end_date='%s'""" \ |
|||
% (data['lawyer_id'], data['end_date']) |
|||
elif data['lawyer_id'] and data['payment_method']: |
|||
query += f""" WHERE lawyer.name ='%s' AND |
|||
case_reg.payment_method='%s'""" \ |
|||
% (data['lawyer_id'], data['payment_method']) |
|||
elif data['lawyer_id'] and data['state']: |
|||
query += f""" WHERE lawyer.name ='%s' AND |
|||
case_reg.state='%s'""" % (data['lawyer_id'], |
|||
data['state']) |
|||
elif data['client_id'] and data['judge_id']: |
|||
query += f""" WHERE res_client.name ='%s' AND |
|||
res_judge.name='%s'""" % (data['client_id'], |
|||
data['judge_id']) |
|||
elif data['client_id'] and data['court_id']: |
|||
query += f""" WHERE res_client.name ='%s' AND |
|||
court.name='%s'""" % (data['client_id'], |
|||
data['court_id']) |
|||
elif data['client_id'] and data['start_date']: |
|||
query += f""" WHERE res_client.name ='%s' AND |
|||
case_reg.start_date='%s'""" % (data['client_id'], |
|||
data['start_date']) |
|||
elif data['client_id'] and data['end_date']: |
|||
query += f""" WHERE res_client.name ='%s' AND |
|||
case_reg.end_date='%s'""" % (data['client_id'], |
|||
data['end_date']) |
|||
elif data['client_id'] and data['payment_method']: |
|||
query += f""" WHERE res_client.name ='%s' AND |
|||
case_reg.payment_method='%s'""" \ |
|||
% (data['client_id'], data['payment_method']) |
|||
elif data['client_id'] and data['state']: |
|||
query += f""" WHERE res_client.name ='%s' AND |
|||
case_reg.state='%s'""" % (data['client_id'], |
|||
data['state']) |
|||
elif data['judge_id'] and data['court_id']: |
|||
query += f""" WHERE res_judge.name ='%s' AND |
|||
court.name='%s'""" % (data['judge_id'], |
|||
data['court_id']) |
|||
elif data['judge_id'] and data['start_date']: |
|||
query += f""" WHERE res_judge.name ='%s' AND |
|||
case_reg.start_date='%s'""" \ |
|||
% (data['judge_id'], data['start_date']) |
|||
elif data['judge_id'] and data['end_date']: |
|||
query += f""" WHERE res_judge.name ='%s' AND |
|||
case_reg.end_date='%s'""" % (data['judge_id'], |
|||
data['end_date']) |
|||
elif data['judge_id'] and data['payment_method']: |
|||
query += f""" WHERE res_judge.name ='%s' AND |
|||
case_reg.payment_method='%s'""" \ |
|||
% (data['judge_id'], data['payment_method']) |
|||
elif data['judge_id'] and data['state']: |
|||
query += f""" WHERE res_judge.name ='%s' AND |
|||
case_reg.state='%s'""" % (data['judge_id'], |
|||
data['state']) |
|||
elif data['court_id'] and data['start_date']: |
|||
query += f""" WHERE court.name ='%s' AND |
|||
case_reg.start_date='%s'""" \ |
|||
% (data['court_id'], data['start_date']) |
|||
elif data['court_id'] and data['end_date']: |
|||
query += f""" WHERE court.name ='%s' AND |
|||
case_reg.end_date='%s'""" \ |
|||
% (data['court_id'], data['end_date']) |
|||
elif data['court_id'] and data['payment_method']: |
|||
query += f""" WHERE court.name ='%s' AND |
|||
case_reg.payment_method='%s'""" \ |
|||
% (data['court_id'], data['payment_method']) |
|||
elif data['court_id'] and data['state']: |
|||
query += f""" WHERE court.name ='%s' AND |
|||
case_reg.state='%s'""" % (data['court_id'], |
|||
data['state']) |
|||
elif data['start_date'] and data['end_date']: |
|||
query += f""" WHERE case_reg.start_date ='%s' AND |
|||
case_reg.end_date='%s'""" \ |
|||
% (data['start_date'], data['end_date']) |
|||
elif data['start_date'] and data['payment_method']: |
|||
query += f""" WHERE case_reg.start_date ='%s' AND |
|||
case_reg.payment_method='%s'""" \ |
|||
% (data['start_date'], data['payment_method']) |
|||
elif data['start_date'] and data['state']: |
|||
query += f""" WHERE case_reg.start_date ='%s' AND |
|||
case_reg.state='%s'""" \ |
|||
% (data['start_date'], data['state']) |
|||
elif data['start_date'] and data['payment_method']: |
|||
query += f""" WHERE case_reg.start_date ='%s' AND |
|||
case_reg.payment_method='%s'""" \ |
|||
% (data['start_date'], data['payment_method']) |
|||
elif data['end_date'] and data['payment_method']: |
|||
query += f""" WHERE case_reg.end_date ='%s' AND |
|||
case_reg.payment_method='%s'""" \ |
|||
% (data['end_date'], data['payment_method']) |
|||
elif data['end_date'] and data['state']: |
|||
query += f""" WHERE case_reg.end_date ='%s' AND |
|||
case_reg.state='%s'""" % (data['end_date'], |
|||
data['state']) |
|||
elif data['payment_method'] and data['state']: |
|||
query += f""" WHERE case_reg.payment_method='%s' AND |
|||
case_reg.state='%s'""" % (data['payment_method'], |
|||
data['state']) |
|||
elif data['lawyer_id']: |
|||
query += f""" WHERE lawyer.name ='%s' """ \ |
|||
% (data['lawyer_id']) |
|||
elif data['client_id']: |
|||
query += f""" WHERE res_client.name ='%s' """ \ |
|||
% (data['client_id']) |
|||
elif data['judge_id']: |
|||
query += f""" WHERE res_judge.name ='%s' """ \ |
|||
% (data['judge_id']) |
|||
elif data['court_id']: |
|||
query += f""" WHERE court.name ='%s' """ \ |
|||
% (data['court_id']) |
|||
elif data['start_date']: |
|||
query += f""" WHERE case_reg.start_date ='%s' """ \ |
|||
% (data['start_date']) |
|||
elif data['end_date']: |
|||
query += f""" WHERE case_reg.end_date ='%s' """ \ |
|||
% (data['end_date']) |
|||
elif data['payment_method']: |
|||
query += f""" WHERE case_reg.payment_method ='%s' """ \ |
|||
% (data['payment_method']) |
|||
elif data['state']: |
|||
query += f""" WHERE case_reg.state ='%s' """ \ |
|||
% (data['state']) |
|||
self.env.cr.execute(query) |
|||
return { |
|||
'data': data, |
|||
'docs': self.env.cr.dictfetchall() |
|||
} |
@ -0,0 +1,76 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Report Template For Case Registration Details--> |
|||
<template id="report_legal_case_details"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<div class="text-center"> |
|||
<h2>Legal Case Report</h2> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<t t-set="i" t-value="1"/> |
|||
<t t-if="docs"> |
|||
<table class="table table-bordered" |
|||
style="table-layout: fixed"> |
|||
<thead> |
|||
<th>Sl.No</th> |
|||
<th>Case No</th> |
|||
<th t-if="client_id">Client</th> |
|||
<th t-if="lawyer_id">Lawyer</th> |
|||
<th t-if="court_id">Court</th> |
|||
<th t-if="judge_id">Judge</th> |
|||
<th t-if="start_date">Start Date</th> |
|||
<th t-if="end_date">End Date</th> |
|||
<th t-if="payment_method">Payment Method</th> |
|||
<th t-if="state">State</th> |
|||
</thead> |
|||
<t t-foreach="docs" t-as="case"> |
|||
<tr> |
|||
<td> |
|||
|
|||
<t t-set="i" t-value="i+1"/> |
|||
</td> |
|||
<td> |
|||
<span t-esc="case['case_name']"/> |
|||
</td> |
|||
<td t-if="client_id"> |
|||
<span t-esc="case['client']"/> |
|||
</td> |
|||
<td t-if="lawyer_id"> |
|||
<span t-esc="case['lawyer']"/> |
|||
</td> |
|||
<td t-if="court_id"> |
|||
<span t-esc="case['court']"/> |
|||
</td> |
|||
<td t-if="judge_id"> |
|||
<span t-esc="case['judge']"/> |
|||
</td> |
|||
<td t-if="start_date"> |
|||
<span t-esc="case['start_date']"/> |
|||
</td> |
|||
<td t-if="end_date"> |
|||
<span t-esc="case['end_date']"/> |
|||
</td> |
|||
<td t-if="payment_method"> |
|||
<span t-esc="case['payment_method']"/> |
|||
</td> |
|||
<td t-if="state"> |
|||
<span t-esc="case['state']"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</table> |
|||
</t> |
|||
<t t-else=""> |
|||
<div style="text-align: center;color:#ff0000; |
|||
font-size:50px; font-weight:bold"> |
|||
No Records |
|||
</div> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
|
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<record id="module_category_legal_case_management" |
|||
model="ir.module.category"> |
|||
<field name="name">Case Management</field> |
|||
<field name="description">Legal Case Management</field> |
|||
<field name="sequence">120</field> |
|||
</record> |
|||
<!-- Groups --> |
|||
<record id="legal_case_management_group_clerk" model="res.groups"> |
|||
<field name="name">Clerk</field> |
|||
<field name="category_id" ref="module_category_legal_case_management"/> |
|||
</record> |
|||
<record id="legal_case_management_group_lawyer" model="res.groups"> |
|||
<field name="name">Lawyer</field> |
|||
<field name="category_id" ref="module_category_legal_case_management"/> |
|||
<field name="implied_ids" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_clerk'))]"/> |
|||
</record> |
|||
<record id="legal_case_management_group_admin" model="res.groups"> |
|||
<field name="name">Admin</field> |
|||
<field name="category_id" ref="module_category_legal_case_management"/> |
|||
<field name="implied_ids" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_lawyer'))]"/> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,66 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<data> |
|||
<!-- Access rights For company of case registration model--> |
|||
<record id="case_registration_rule_company" model="ir.rule"> |
|||
<field name="name">Legal Case: multi-company</field> |
|||
<field name="model_id" ref="model_case_registration"/> |
|||
<field name="domain_force"> |
|||
['|',('company_id','=',False),('company_id', 'in', company_ids)] |
|||
</field> |
|||
</record> |
|||
<!--Access Rights For Admin of case registration model --> |
|||
<record id="case_registration_rule_admin" model="ir.rule"> |
|||
<field name="name">Admin All Case only view Rule</field> |
|||
<field name="model_id" ref="model_case_registration"/> |
|||
<field name="domain_force">[(1,'=',1)]</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_admin'))]"/> |
|||
</record> |
|||
<!--Access Rights For Lawyer of case registration model--> |
|||
<record id="case_registration_rule_lawyer" model="ir.rule"> |
|||
<field name="name">Own Case view Rule</field> |
|||
<field name="model_id" ref="model_case_registration"/> |
|||
<field name="domain_force">[('lawyer_id.user_id','=',user.id)] |
|||
</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_lawyer'))]"/> |
|||
</record> |
|||
<!--Access Rights for Admin of legal evidence model--> |
|||
<record id="legal_evidence_rule_admin" model="ir.rule"> |
|||
<field name="name">Admin All Evidence only view Rule</field> |
|||
<field name="model_id" ref="model_legal_evidence"/> |
|||
<field name="domain_force">[(1,'=',1)]</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_admin'))]"/> |
|||
</record> |
|||
<!--Access Rights For Lawyer of legal evidence model--> |
|||
<record id="legal_evidence_rule_lawyer" model="ir.rule"> |
|||
<field name="name">Own Evidence view Rule</field> |
|||
<field name="model_id" ref="model_legal_evidence"/> |
|||
<field name="domain_force"> |
|||
[('case_id.lawyer_id.user_id','=',user.id)] |
|||
</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_lawyer'))]"/> |
|||
</record> |
|||
<!--Access Rights For Admin of legal trial model--> |
|||
<record id="legal_trial_rule_admin" model="ir.rule"> |
|||
<field name="name">Admin All Trial only view Rule</field> |
|||
<field name="model_id" ref="model_legal_trial"/> |
|||
<field name="domain_force">[(1,'=',1)]</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_admin'))]"/> |
|||
</record> |
|||
<!--Access Rights For Lawyer of legal trial model--> |
|||
<record id="legal_trial_rule_lawyer" model="ir.rule"> |
|||
<field name="name">Own Trial view Rule</field> |
|||
<field name="model_id" ref="model_legal_trial"/> |
|||
<field name="domain_force"> |
|||
[('case_id.lawyer_id.user_id','=',user.id)] |
|||
</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('legal_case_management.legal_case_management_group_lawyer'))]"/> |
|||
</record> |
|||
</data> |
|||
</odoo> |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 229 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |