18 changed files with 201 additions and 696 deletions
After Width: | Height: | Size: 31 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,267 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################### |
|||
# A part of OpenHRMS Project <https://www.openhrms.com> |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu (<https://www.cybrosys.com>) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# 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 Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################### |
|||
from datetime import datetime, timedelta |
|||
from odoo import models, fields, api, _ |
|||
from odoo.exceptions import Warning |
|||
from odoo.http import request |
|||
|
|||
|
|||
class HrLawsuit(models.Model): |
|||
_name = 'hr.lawsuit' |
|||
_description = 'Hr Lawsuit Management' |
|||
_inherit = ['mail.thread', 'mail.activity.mixin'] |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
vals['name'] = self.env['ir.sequence'].next_by_code('hr.lawsuit') |
|||
return super(HrLawsuit, self).create(vals) |
|||
|
|||
@api.multi |
|||
def won(self): |
|||
self.state = 'won' |
|||
|
|||
@api.multi |
|||
def cancel(self): |
|||
self.state = 'cancel' |
|||
|
|||
@api.multi |
|||
def loss(self): |
|||
self.state = 'fail' |
|||
|
|||
@api.multi |
|||
def process(self): |
|||
self.state = 'running' |
|||
|
|||
@api.depends('customer_id') |
|||
def set_pending_invoices(self): |
|||
for each1 in self: |
|||
invoice_list = [] |
|||
for each in self.env['account.invoice'].sudo().search([('type', '=', 'out_invoice'), ('state', '=', 'open'), |
|||
('partner_id', '=', each1.customer_id.id)]): |
|||
values = {'invoice_ref': each.id, |
|||
'invoice_date': each.date_invoice, |
|||
'due_date': each.date_due, |
|||
'total': each.amount_total, |
|||
'due_amount': each.residual} |
|||
invoice_list.append(values) |
|||
each1.pending_invoices = invoice_list |
|||
|
|||
def mail_reminder(self): |
|||
now = datetime.now() + timedelta(days=2) |
|||
date_now = now.date() |
|||
match = self.search([('state', '=', 'running')]) |
|||
lawsuit_managers = self.env.ref('oh_hr_lawsuit_management.lawsuit_group_manager').users |
|||
recipient_ids = [] |
|||
for each in lawsuit_managers: |
|||
recipient_ids.append(each.partner_id.id) |
|||
for i in match: |
|||
for j in i.case_record: |
|||
if j.next_action: |
|||
next_action_exp_date = fields.Date.from_string(j.case_date) |
|||
if next_action_exp_date == date_now: |
|||
base_url = self.env['ir.config_parameter'].get_param('web.base.url') |
|||
url = base_url + _('/web#id=%s&view_type=form&model=hr.lawsuit&menu_id=') % i.id |
|||
mail_content = _('Hi,<br> The next action date of %s is %s. Please note it.' |
|||
'<br> <div style = "text-align: left; margin-top: 16px;"><a href = "%s"' |
|||
'style = "padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; ' |
|||
'border-color:#875A7B;text-decoration: none; display: inline-block; ' |
|||
'margin-bottom: 0px; font-weight: 400;text-align: center; vertical-align: middle; ' |
|||
'cursor: pointer; white-space: nowrap; background-image: none; ' |
|||
'background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px;">' |
|||
'View %s</a></div>') % \ |
|||
(i.name, i.next_date, url, i.name) |
|||
main_content = { |
|||
'subject': _('REMINDER On Next Action of %s') % i.name, |
|||
'author_id': self.env.user.partner_id.id, |
|||
'body_html': mail_content, |
|||
'recipient_ids': [(6, 0, recipient_ids)], |
|||
} |
|||
mail_id = self.env['mail.mail'].sudo().create(main_content) |
|||
mail_id.mail_message_id.body = mail_content |
|||
mail_id.send() |
|||
mail_id.mail_message_id.write( |
|||
{'needaction_partner_ids': [(4, j) for j in recipient_ids]}) |
|||
mail_id.mail_message_id.write({'partner_ids': [(4, j) for j in recipient_ids]}) |
|||
|
|||
if i.next_date: |
|||
exp_date = fields.Date.from_string(i.next_date) |
|||
if exp_date == date_now: |
|||
base_url = self.env['ir.config_parameter'].get_param('web.base.url') |
|||
url = base_url + _('/web#id=%s&view_type=form&model=hr.lawsuit&menu_id=') % i.id |
|||
mail_content = _('Hi,<br> The next hearing or next action date of %s is %s. Please note it.' |
|||
'<br> <div style = "text-align: left; margin-top: 16px;"><a href = "%s"' |
|||
'style = "padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; ' |
|||
'border-color:#875A7B;text-decoration: none; display: inline-block; ' |
|||
'margin-bottom: 0px; font-weight: 400;text-align: center; vertical-align: middle; ' |
|||
'cursor: pointer; white-space: nowrap; background-image: none; ' |
|||
'background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px;">' |
|||
'View %s</a></div>') % \ |
|||
(i.name, i.next_date, url, i.name) |
|||
main_content = { |
|||
'subject': _('REMINDER On %s') % i.name, |
|||
'author_id': self.env.user.partner_id.id, |
|||
'body_html': mail_content, |
|||
'recipient_ids': [(6, 0, recipient_ids)], |
|||
} |
|||
mail_id = self.env['mail.mail'].sudo().create(main_content) |
|||
mail_id.mail_message_id.body = mail_content |
|||
mail_id.send() |
|||
mail_id.mail_message_id.write( |
|||
{'needaction_partner_ids': [(4, j) for j in recipient_ids]}) |
|||
mail_id.mail_message_id.write({'partner_ids': [(4, j) for j in recipient_ids]}) |
|||
|
|||
@api.depends('party2', 'employee_id', 'customer_id', 'supplier_id') |
|||
def set_party2(self): |
|||
for each in self: |
|||
if each.party2 == 'employee': |
|||
each.party2_name = each.employee_id.name |
|||
elif each.party2 == 'supplier': |
|||
each.party2_name = each.supplier_id.name |
|||
elif each.party2 == 'customer': |
|||
each.party2_name = each.customer_id.name |
|||
|
|||
name = fields.Char(string='Code', copy=False) |
|||
company_id = fields.Many2one('res.company', 'Company', readonly=True, |
|||
default=lambda self: self.env.user.company_id) |
|||
requested_date = fields.Date(string='Date', copy=False, readonly=1, default=datetime.now(), |
|||
states={'draft': [('readonly', False)]}) |
|||
next_date = fields.Datetime(string='Next Hearing Date', eadonly=1, copy=False, readonly=1, |
|||
track_visibility='always', |
|||
states={'draft': [('readonly', False)]}, default=datetime.now()) |
|||
attachment_id = fields.Many2many('ir.attachment', 'case_attach_rel11', 'law_id11', 'case_id11', |
|||
string="Next Hearing Requirement", |
|||
help='You can attach the copy of your document') |
|||
court_name = fields.Many2one('court.court', string='Court Name', track_visibility='always', |
|||
states={'won': [('readonly', True)]}) |
|||
judge = fields.Char(string='Judge', track_visibility='always', states={'won': [('readonly', True)]}) |
|||
lawyer = fields.Char(string='Lawyer', track_visibility='always', states={'won': [('readonly', True)]}) |
|||
party1 = fields.Many2one('res.company', string='Party 1', required=1, readonly=1, |
|||
states={'draft': [('readonly', False)]}) |
|||
party2 = fields.Selection([('employee', 'Employee'), |
|||
('supplier', 'Supplier'), |
|||
('customer', 'Customer'), |
|||
], string='Party 2', required=1, readonly=1, states={'draft': [('readonly', False)]}) |
|||
employee_id = fields.Many2one('hr.employee', string='Employee', copy=False, |
|||
readonly=1, states={'draft': [('readonly', False)]}) |
|||
customer_id = fields.Many2one('res.partner', string='Customer', copy=False, |
|||
readonly=1, states={'draft': [('readonly', False)]}) |
|||
supplier_id = fields.Many2one('res.partner', string='Supplier', copy=False, |
|||
readonly=1, states={'draft': [('readonly', False)]}) |
|||
party2_name = fields.Char(compute='set_party2', string='Name', store=True) |
|||
case_record = fields.One2many('case.details', 'lawsuit_obj') |
|||
pending_invoices = fields.One2many('law.pending.invoice', 'law_obj', compute='set_pending_invoices', readonly=1, |
|||
store=True, cascade=True) |
|||
case_details = fields.Html(string='Case Details', copy=False, track_visibility='always') |
|||
state = fields.Selection([('draft', 'Draft'), |
|||
('running', 'Running'), |
|||
('cancel', 'Cancelled'), |
|||
('fail', 'Failed'), |
|||
('won', 'Won')], string='Status', |
|||
default='draft', track_visibility='always', copy=False) |
|||
|
|||
|
|||
class CourtCourt(models.Model): |
|||
_name = 'court.court' |
|||
|
|||
name = fields.Char(string='Name') |
|||
place = fields.Char(string='Place') |
|||
|
|||
|
|||
class HrCaseDetails(models.Model): |
|||
_name = 'case.details' |
|||
_description = 'Case Details' |
|||
|
|||
case_date = fields.Datetime(string='Date') |
|||
cse_details = fields.Text(string='Case Details') |
|||
court_name = fields.Char(string='Court Name') |
|||
next_action = fields.Char(string='Next Action') |
|||
judge = fields.Char(string='Judge') |
|||
lawyer = fields.Char(string='Lawyer') |
|||
lawsuit_obj = fields.Many2one('hr.lawsuit', invisible=1) |
|||
attachment_id = fields.Many2many('ir.attachment', 'case_attach_rel1', 'law_id1', 'case_id1', |
|||
string="Attachments", |
|||
help='You can attach the copy of your document') |
|||
|
|||
|
|||
class WizardLawsuit(models.TransientModel): |
|||
_name = 'wizard.lawsuit' |
|||
|
|||
@api.onchange('is_next_action') |
|||
def onchange_action(self): |
|||
if self.is_next_action: |
|||
self.next_date = '' |
|||
else: |
|||
self.next_action = '' |
|||
|
|||
@api.multi |
|||
def follow_up(self): |
|||
context = self._context |
|||
lawsuit_obj = self.env['hr.lawsuit'].search([('id', '=', context.get('lawsuit_id'))]) |
|||
if self.is_next_action: |
|||
self.env['case.details'].sudo().create({'case_date': self.next_action_date, |
|||
'cse_details': self.case_details, |
|||
'next_action': self.next_action, |
|||
'court_name': lawsuit_obj.court_name.name, |
|||
'judge': lawsuit_obj.judge, |
|||
'lawyer': lawsuit_obj.lawyer, |
|||
'lawsuit_obj': lawsuit_obj.id, |
|||
'attachment_id': [(6, 0, self.attachment_id.ids)]}) |
|||
lawsuit_obj.write({'attachment_id': [(6, 0, self.attachment_id.ids)]}) |
|||
else: |
|||
self.env['case.details'].sudo().create({'case_date': lawsuit_obj.next_date, |
|||
'cse_details': self.case_details, |
|||
'court_name': lawsuit_obj.court_name.name, |
|||
'judge': lawsuit_obj.judge, |
|||
'lawyer': lawsuit_obj.lawyer, |
|||
'lawsuit_obj': lawsuit_obj.id, |
|||
'attachment_id': [(6, 0, self.attachment_id.ids)]}) |
|||
lawsuit_obj.write({'next_date': self.next_date, |
|||
'attachment_id': [(6, 0, self.attachment_id.ids)]}) |
|||
|
|||
next_date = fields.Datetime(string='Next Hearing Date') |
|||
next_action_date = fields.Datetime(string='Next Action Date') |
|||
is_next_action = fields.Boolean(string='Is Next Action?') |
|||
next_action = fields.Char(string='Next Action') |
|||
case_details = fields.Text(string='Previous Case Details') |
|||
attachment_id = fields.Many2many('ir.attachment', 'case_attach_rel', 'law_id', 'case_id', |
|||
string="Next Hearing Requirement", |
|||
help='You can attach the copy of your document') |
|||
|
|||
|
|||
class PendingInvoices(models.Model): |
|||
_name = 'law.pending.invoice' |
|||
|
|||
law_obj = fields.Many2one('hr.lawsuit', invisible=1) |
|||
invoice_ref = fields.Many2one('account.invoice', string='Invoice') |
|||
invoice_date = fields.Date(string='Invoice Date') |
|||
due_date = fields.Date(string='Due Date') |
|||
total = fields.Float(string='Total Amount') |
|||
due_amount = fields.Float(string='Balance Payment') |
|||
|
|||
|
|||
class HrEmployeeAttachmentLegal(models.Model): |
|||
_inherit = 'ir.attachment' |
|||
|
|||
case_attach_rel = fields.Many2many('wizard.lawsuit', 'attachment_id', 'case_id', 'law_id', invisible=1) |
|||
case_attach_rel1 = fields.Many2many('case.details', 'attachment_id', 'case_id1', 'law_id1', invisible=1) |
|||
case_attach_rel11 = fields.Many2many('hr.lawsuit', 'attachment_id', 'case_id11', 'law_id11', invisible=1) |
@ -1,85 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
<template id="report_pdf_case"> |
|||
<t t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<div class="row"> |
|||
<div class="header" style="text-align:center;"><h1><strong>Case Report</strong></h1></div> |
|||
<div class="row mt32 mb32" style="text-align:center;"> |
|||
<div class="col-xs-4"> |
|||
<strong>Code</strong> |
|||
<p t-esc="o.name"/> |
|||
</div> |
|||
<div class="col-xs-4"> |
|||
<strong>Party 1:</strong> |
|||
<p t-esc="o.party1.name"/> |
|||
</div> |
|||
<div class="col-xs-4"> |
|||
<strong>Party 2:</strong> |
|||
<t t-if="o.party2 == 'employee'"> |
|||
<p t-esc="o.employee_id.name"/> |
|||
</t> |
|||
<t t-if="o.party2 == 'supplier'"> |
|||
<p t-esc="o.supplier_id.name"/> |
|||
</t> |
|||
<t t-if="o.party2 == 'customer'"> |
|||
<p t-esc="o.customer_id.name"/> |
|||
</t> |
|||
</div> |
|||
</div> |
|||
<table class="table table-condensed"> |
|||
<thead> |
|||
<tr> |
|||
<th>Date</th> |
|||
<th>Next Action</th> |
|||
<th>Case Details</th> |
|||
<th>Court Name</th> |
|||
<th>Judge</th> |
|||
<th>Lawyer</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-foreach="o.case_record" t-as="case"> |
|||
<tr> |
|||
<td> |
|||
<span t-att-style="style" t-esc="case.case_date"/> |
|||
</td> |
|||
<td> |
|||
<span t-att-style="style" t-esc="case.next_action"/> |
|||
</td> |
|||
<td> |
|||
<span t-att-style="style" t-esc="case.cse_details"/> |
|||
</td> |
|||
<td> |
|||
<span t-att-style="style" t-esc="case.court_name"/> |
|||
</td> |
|||
<td> |
|||
<span t-att-style="style" t-esc="case.judge"/> |
|||
</td> |
|||
<td> |
|||
<span t-att-style="style" t-esc="case.lawyer"/> |
|||
</td> |
|||
</tr> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</template> |
|||
|
|||
<template id="report_case_base"> |
|||
<t t-call="web.html_container"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-call="oh_hr_lawsuit_management.report_pdf_case"/> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
|
|||
<report id="action_report_case" |
|||
model="hr.lawsuit" |
|||
report_type="qweb-pdf" |
|||
string="Case Report" |
|||
name="oh_hr_lawsuit_management.report_case_base" |
|||
file="oh_hr_lawsuit_management.report_case_base"/> |
|||
</odoo> |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 98 KiB |
@ -1,30 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record model="ir.ui.view" id="legal_hr_employee_inherit_form_view"> |
|||
<field name="name">hr.employee.form.inherit.view</field> |
|||
<field name="model">hr.employee</field> |
|||
<field name="inherit_id" ref="hr.view_employee_form"/> |
|||
<field name="arch" type="xml"> |
|||
<div class="oe_button_box" position="inside"> |
|||
<button class="oe_stat_button" name="legal_view" type="object" icon="fa-exclamation-circle"> |
|||
<field string="Legal Actions" name="legal_count" widget="statinfo"/> |
|||
</button> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="legal_res_partner_inherit_form_view"> |
|||
<field name="name">res.partner.form.inherit.view</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<div class="oe_button_box" position="inside"> |
|||
<button class="oe_stat_button" name="legal_view" type="object" icon="fa-exclamation-circle"> |
|||
<field string="Legal Actions" name="legal_count" widget="statinfo"/> |
|||
</button> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -1,204 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="lawsuit_seq" model="ir.sequence"> |
|||
<field name="name">Lawsuit Code</field> |
|||
<field name="code">hr.lawsuit</field> |
|||
<field name="prefix">LC</field> |
|||
<field eval="4" name="padding"/> |
|||
</record> |
|||
|
|||
<record model="ir.cron" id="lawsuit_data_reminder"> |
|||
<field name="name">Legal Next Call Notification</field> |
|||
<field name="interval_number">1</field> |
|||
<field name="interval_type">days</field> |
|||
<field name="numbercall">-1</field> |
|||
<field name="doall" eval="False"/> |
|||
<field name="model_id" ref="model_hr_lawsuit"/> |
|||
<field name="state">code</field> |
|||
<field name="code">model.mail_reminder()</field> |
|||
</record> |
|||
|
|||
<record model='ir.ui.view' id='wizard_lawsuit_followup'> |
|||
<field name="name">wizard.lawsuit.form</field> |
|||
<field name="model">wizard.lawsuit</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Follow Next Hearing Date"> |
|||
<group> |
|||
<field name="is_next_action" /> |
|||
<field name="next_date" string="Next Hearing Date" attrs="{'invisible': [('is_next_action','=',True)], |
|||
'required': [('is_next_action','=',False)]}"/> |
|||
<field name="next_action_date" string="Next Action Date" attrs="{'invisible': [('is_next_action','=',False)], |
|||
'required': [('is_next_action','=',True)]}"/> |
|||
<field name="next_action" attrs="{'invisible': [('is_next_action','=',False)], |
|||
'required': [('is_next_action','=',True)]}"/> |
|||
<field name="case_details"/> |
|||
<field name="attachment_id" widget="many2many_binary" class="oe_inline"/> |
|||
</group> |
|||
<footer> |
|||
<button name="follow_up" string="Follow Up" type="object" class="oe_highlight"/> |
|||
or |
|||
<button string="Cancel" class="oe_link" special="cancel" /> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model='ir.actions.act_window' id='wizard_lawsuit_act'> |
|||
<field name="name">Follow Next Hearing Date</field> |
|||
<field name="res_model">wizard.lawsuit</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="wizard_lawsuit_followup"/> |
|||
<field name="target">new</field> |
|||
</record> |
|||
|
|||
<record model='ir.ui.view' id='hr_lawsuit_form_view'> |
|||
<field name="name">hr.lawsuit.form</field> |
|||
<field name="model">hr.lawsuit</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Legal Actions"> |
|||
<header> |
|||
<button name="process" string="Process" type="object" states="draft"/> |
|||
<button name="won" string="Won" type="object" states="running"/> |
|||
<button name="loss" string="Loss" type="object" states="running"/> |
|||
<button name="cancel" string="Cancel" type="object" states="running,draft"/> |
|||
<button name="%(wizard_lawsuit_act)d" string="Follow Up" type="action" states="running" |
|||
context="{'lawsuit_id':id}"/> |
|||
<field name="state" widget="statusbar" statusbar_visible="draft,running,won"/> |
|||
</header> |
|||
<sheet> |
|||
<label for="name" class="oe_edit_only"/> |
|||
<h1> |
|||
<field name="name" readonly="1"/> |
|||
</h1> |
|||
<group> |
|||
<group> |
|||
<field name="party1"/> |
|||
<field name="party2_name" invisible="1"/> |
|||
<field name="party2"/> |
|||
<field name="employee_id" attrs="{'invisible': [('party2','!=','employee')], |
|||
'required': [('party2','=','employee')]}"/> |
|||
<field name="customer_id" domain="[('customer','=',True)]" |
|||
attrs="{'invisible': [('party2','!=','customer')], |
|||
'required': [('party2','=','customer')]}"/> |
|||
<field name="supplier_id" domain="[('supplier','=',True)]" |
|||
attrs="{'invisible': [('party2','!=','supplier')], |
|||
'required': [('party2','=','supplier')]}"/> |
|||
<field name="court_name"/> |
|||
<field name="judge"/> |
|||
<field name="lawyer"/> |
|||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> |
|||
</group> |
|||
<group> |
|||
<field name="requested_date"/> |
|||
<field name="next_date"/> |
|||
<field name="attachment_id" widget="many2many_binary" class="oe_inline"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page name="pending_invoice" string="Pending Invoices"> |
|||
<field name="pending_invoices"> |
|||
<tree> |
|||
<field name="law_obj" invisible="1"/> |
|||
<field name="invoice_ref"/> |
|||
<field name="invoice_date"/> |
|||
<field name="due_date"/> |
|||
<field name="total"/> |
|||
<field name="due_amount"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
<page name="case_desc" string="Case Details"> |
|||
<field name="case_details"/> |
|||
</page> |
|||
<page name="case_records" string="Case Reports"> |
|||
<field name="case_record" readonly="1"> |
|||
<tree editable="bottom"> |
|||
<field name="case_date"/> |
|||
<field name="next_action"/> |
|||
<field name="cse_details"/> |
|||
<field name="court_name"/> |
|||
<field name="judge"/> |
|||
<field name="lawyer"/> |
|||
<field name="attachment_id" widget="many2many_binary" class="oe_inline"/> |
|||
<field name="lawsuit_obj" invisible="1"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="message_follower_ids" widget="mail_followers"/> |
|||
<field name="message_ids" widget="mail_thread"/> |
|||
</div> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model='ir.ui.view' id='hr_lawsuit_tree_view'> |
|||
<field name="name">hr.lawsuit.tree</field> |
|||
<field name="model">hr.lawsuit</field> |
|||
<field name="arch" type="xml"> |
|||
<tree decoration-info="state == 'draft'" colors="grey:state == 'cancel';green:state == 'won'; |
|||
red:state == 'fail';green:state == 'running';"> |
|||
<field name="name"/> |
|||
<field name="party1"/> |
|||
<field name="party2"/> |
|||
<field name="party2_name"/> |
|||
<field name="court_name"/> |
|||
<field name="judge"/> |
|||
<field name="lawyer"/> |
|||
<field name="requested_date"/> |
|||
<field name="next_date"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model='ir.ui.view' id='hr_lawsuit_search_view'> |
|||
<field name="name">hr.lawsuit.search</field> |
|||
<field name="model">hr.lawsuit</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Lawsuit"> |
|||
<field name="name"/> |
|||
<field name="party1"/> |
|||
<field name="party2"/> |
|||
<field name="court_name"/> |
|||
<field name="judge"/> |
|||
<field name="lawyer"/> |
|||
<field name="requested_date"/> |
|||
<field name="next_date"/> |
|||
<field name="state"/> |
|||
<separator/> |
|||
<group expand="0" string="Group By"> |
|||
<filter string="Status" domain="[]" context="{'group_by':'state'}"/> |
|||
<filter string="Employee" domain="[]" context="{'group_by':'employee_id'}"/> |
|||
<filter string="Customer" domain="[]" context="{'group_by':'customer_id'}"/> |
|||
<filter string="Supplier" domain="[]" context="{'group_by':'supplier_id'}"/> |
|||
<filter string="Lawyer Name" domain="[]" context="{'group_by':'lawyer'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_hr_lawsuit" model="ir.actions.act_window"> |
|||
<field name="name">Legal Management</field> |
|||
<field name="res_model">hr.lawsuit</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="search_view_id" ref="hr_lawsuit_search_view"/> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to Create a New Record. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<menuitem id="hr_lawsuit_menu" |
|||
name="Legal Actions" parent="hr.menu_hr_root" sequence="17" groups="lawsuit_group_manager"/> |
|||
|
|||
<menuitem id="hr_lawsuit_sub_menu" parent="hr_lawsuit_menu" action="action_hr_lawsuit" |
|||
name="Legal Actions" sequence="1" groups="lawsuit_group_manager"/> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,130 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="lawsuit_seq" model="ir.sequence"> |
|||
<field name="name">Lawsuit Code</field> |
|||
<field name="code">hr.lawsuit</field> |
|||
<field name="prefix">LC</field> |
|||
<field eval="4" name="padding"/> |
|||
</record> |
|||
|
|||
<record model='ir.ui.view' id='hr_lawsuit_form_view'> |
|||
<field name="name">hr.lawsuit.form</field> |
|||
<field name="model">hr.lawsuit</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Legal Actions"> |
|||
<header> |
|||
<button name="process" string="Process" type="object" states="draft"/> |
|||
<button name="won" string="Won" type="object" states="running"/> |
|||
<button name="loss" string="Loss" type="object" states="running"/> |
|||
<button name="cancel" string="Cancel" type="object" states="running,draft"/> |
|||
<field name="state" widget="statusbar" statusbar_visible="draft,running,won"/> |
|||
</header> |
|||
<sheet> |
|||
<label for="name" class="oe_edit_only"/> |
|||
<h1> |
|||
<field name="name" readonly="1"/> |
|||
</h1> |
|||
<group> |
|||
<group> |
|||
<field name="party1"/> |
|||
<field name="party2_name" invisible="1"/> |
|||
<field name="party2"/> |
|||
<field name="employee_id" attrs="{'invisible': [('party2','!=','employee')], |
|||
'required': [('party2','=','employee')]}"/> |
|||
<field name="court_name"/> |
|||
<field name="judge"/> |
|||
<field name="lawyer"/> |
|||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> |
|||
</group> |
|||
<group> |
|||
<field name="requested_date"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page name="case_desc" string="Case Details"> |
|||
<field name="case_details"/> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="message_follower_ids" widget="mail_followers"/> |
|||
<field name="message_ids" widget="mail_thread"/> |
|||
</div> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model='ir.ui.view' id='hr_lawsuit_tree_view'> |
|||
<field name="name">hr.lawsuit.tree</field> |
|||
<field name="model">hr.lawsuit</field> |
|||
<field name="arch" type="xml"> |
|||
<tree> |
|||
<field name="name"/> |
|||
<field name="party1"/> |
|||
<field name="party2"/> |
|||
<field name="party2_name"/> |
|||
<field name="court_name"/> |
|||
<field name="judge"/> |
|||
<field name="lawyer"/> |
|||
<field name="requested_date"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model='ir.ui.view' id='hr_lawsuit_search_view'> |
|||
<field name="name">hr.lawsuit.search</field> |
|||
<field name="model">hr.lawsuit</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Legal Actions"> |
|||
<field name="name"/> |
|||
<field name="party1"/> |
|||
<field name="party2"/> |
|||
<field name="court_name"/> |
|||
<field name="judge"/> |
|||
<field name="lawyer"/> |
|||
<field name="requested_date"/> |
|||
<field name="state"/> |
|||
<separator/> |
|||
<group expand="0" string="Group By"> |
|||
<filter string="Status" domain="[]" context="{'group_by':'state'}"/> |
|||
<filter string="Employee" domain="[]" context="{'group_by':'employee_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_hr_lawsuit" model="ir.actions.act_window"> |
|||
<field name="name">Legal Management</field> |
|||
<field name="res_model">hr.lawsuit</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="search_view_id" ref="hr_lawsuit_search_view"/> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to Create a New Record. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="legal_hr_employee_inherit_form_view"> |
|||
<field name="name">hr.employee.form.inherit.view</field> |
|||
<field name="model">hr.employee</field> |
|||
<field name="inherit_id" ref="hr.view_employee_form"/> |
|||
<field name="arch" type="xml"> |
|||
<div class="oe_button_box" position="inside"> |
|||
<button class="oe_stat_button" name="legal_view" type="object" icon="fa-exclamation-circle"> |
|||
<field string="Legal Actions" name="legal_count" widget="statinfo"/> |
|||
</button> |
|||
</div> |
|||
</field> |
|||
</record> |
|||
|
|||
<menuitem id="hr_lawsuit_menu" |
|||
name="Legal Department" parent="hr.menu_hr_root" sequence="17" groups="lawsuit_group_manager"/> |
|||
|
|||
<menuitem id="hr_lawsuit_sub_menu" parent="hr_lawsuit_menu" action="action_hr_lawsuit" |
|||
name="Legal Actions" sequence="1" groups="lawsuit_group_manager"/> |
|||
</data> |
|||
</odoo> |
Loading…
Reference in new issue