Skip to content

[FIX] hr_employee_updation: access right to ir.config_parameter #77

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: 14.0
Choose a base branch
from
2 changes: 1 addition & 1 deletion attendance_regularization/models/regularization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _get_employee_id(self):
required=True, help='Employee')
state_select = fields.Selection([('draft', 'Draft'), ('requested', 'Requested'), ('reject', 'Rejected'),
('approved', 'Approved')
], default='draft', track_visibility='onchange', string='State',
], default='draft', tracking=True, string='State',
help='State')


Expand Down
1 change: 1 addition & 0 deletions employee_background/models/employee_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class EmployeeVerification(models.Model):
_name = 'employee.verification'
_description = 'Employee Verification'
_rec_name = 'verification_id'

verification_id = fields.Char('ID', readonly=True, copy=False, help="Verification Id")
Expand Down
1 change: 1 addition & 0 deletions employee_background/models/xls_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class DefaultTemplateXls(models.AbstractModel):
_name = 'report.employee_background.default_verification_details'
_description = 'Report DefaultTemplateXls'
# _inherit = 'report.report_xlsx.abstract'

_logger = logging.getLogger(__name__)
Expand Down
4 changes: 4 additions & 0 deletions history_employee/models/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def onchange_dateend(self):

class DepartmentHistory(models.Model):
_name = 'department.history'
_description = 'Department History'

employee_id = fields.Char(string='Employee Id', help="Employee")
employee_name = fields.Char(string='Employee Name', help="Name")
Expand All @@ -200,6 +201,7 @@ class DepartmentHistory(models.Model):

class TimesheetCost(models.Model):
_name = 'timesheet.cost'
_description = 'Timesheet Cost'

employee_id = fields.Char(string='Employee Id', help="Employee")
employee_name = fields.Char(string='Employee Name', help="Name")
Expand All @@ -209,6 +211,7 @@ class TimesheetCost(models.Model):

class SalaryHistory(models.Model):
_name = 'salary.history'
_description = 'Salary History'

employee_id = fields.Char(string='Employee Id', help="Employee")
employee_name = fields.Char(string='Employee Name', help="Name")
Expand All @@ -218,6 +221,7 @@ class SalaryHistory(models.Model):

class ContractHistory(models.Model):
_name = 'contract.history'
_description = 'Contract History'

employee_id = fields.Char(string='Employee Id', help="Employee")
employee_name = fields.Char(string='Employee Name', help="Name")
Expand Down
1 change: 1 addition & 0 deletions hr_company_policy/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class CompanyPolicy(models.Model):

class PolicyWizard(models.TransientModel):
_name = 'res.company.policy'
_description = 'Policy Wizard'

company_id = fields.Many2one('res.company', help="Company")
policy_info = fields.Html(related='company_id.company_info')
Expand Down
10 changes: 5 additions & 5 deletions hr_custody/models/custody.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,28 @@ def validate_return_date(self):
rejected_reason = fields.Text(string='Rejected Reason', copy=False, readonly=1, help="Reason for the rejection")
renew_rejected_reason = fields.Text(string='Renew Rejected Reason', copy=False, readonly=1,
help="Renew rejected reason")
date_request = fields.Date(string='Requested Date', required=True, track_visibility='always', readonly=True,
date_request = fields.Date(string='Requested Date', required=True, tracking=True, readonly=True,
help="Requested date",
states={'draft': [('readonly', False)]}, default=datetime.now().strftime('%Y-%m-%d'))
employee = fields.Many2one('hr.employee', string='Employee', required=True, readonly=True, help="Employee",
default=lambda self: self.env.user.employee_id.id,
states={'draft': [('readonly', False)]})
purpose = fields.Char(string='Reason', track_visibility='always', required=True, readonly=True, help="Reason",
purpose = fields.Char(string='Reason', tracking=True, required=True, readonly=True, help="Reason",
states={'draft': [('readonly', False)]})
custody_name = fields.Many2one('custody.property', string='Property', required=True, readonly=True,
help="Property name",
states={'draft': [('readonly', False)]})
return_date = fields.Date(string='Return Date', required=True, track_visibility='always', readonly=True,
return_date = fields.Date(string='Return Date', required=True, tracking=True, readonly=True,
help="Return date",
states={'draft': [('readonly', False)]})
renew_date = fields.Date(string='Renewal Return Date', track_visibility='always',
renew_date = fields.Date(string='Renewal Return Date', tracking=True,
help="Return date for the renewal", readonly=True, copy=False)
notes = fields.Html(string='Notes')
renew_return_date = fields.Boolean(default=False, copy=False)
renew_reject = fields.Boolean(default=False, copy=False)
state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'), ('approved', 'Approved'),
('returned', 'Returned'), ('rejected', 'Refused')], string='Status', default='draft',
track_visibility='always')
tracking=True)
mail_send = fields.Boolean(string="Mail Send")


Expand Down
1 change: 1 addition & 0 deletions hr_custody/models/wizard_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class WizardReason(models.TransientModel):
Hr custody contract refuse wizard.
"""
_name = 'wizard.reason'
_description = 'Custody Reason'

def send_reason(self):
context = self._context
Expand Down
2 changes: 1 addition & 1 deletion hr_disciplinary_tracking/models/disciplinary_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DisciplinaryAction(models.Model):
('action', 'Action Validated'),
('cancel', 'Cancelled'),

], default='draft', track_visibility='onchange')
], default='draft', tracking=True)

name = fields.Char(string='Reference', required=True, copy=False, readonly=True,
default=lambda self: _('New'))
Expand Down
1 change: 1 addition & 0 deletions hr_employee_shift/models/hr_employee_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class HrEmployeeContract(models.Model):

class HrSchedule(models.Model):
_name = 'hr.shift.schedule'
_description = 'HR Schedule'

start_date = fields.Date(string="Date From", required=True, help="Starting date for the shift")
end_date = fields.Date(string="Date To", required=True, help="Ending date for the shift")
Expand Down
1 change: 1 addition & 0 deletions hr_employee_shift/models/hr_generate_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

class HrGenerateShift(models.Model):
_name = 'hr.shift.generate'
_description = 'HR Generate Shift'

hr_department = fields.Many2one('hr.department', string="Department", help="Department")
start_date = fields.Date(string="Start Date", required=True, help="Start date")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 3 additions & 4 deletions hr_employee_updation/models/hr_contract_days.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ class HrEmployeeContract(models.Model):
_inherit = 'hr.contract'

def _get_default_notice_days(self):
if self.env['ir.config_parameter'].get_param(
'hr_resignation.notice_period'):
return self.env['ir.config_parameter'].get_param(
'hr_resignation.no_of_days')
get_param = self.env['ir.config_parameter'].sudo().get_param
if get_param('hr_resignation.notice_period'):
return get_param('hr_resignation.no_of_days')
else:
return 0

Expand Down
1 change: 1 addition & 0 deletions hr_employee_updation/models/hr_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ class EmployeeRelationInfo(models.Model):
"""Table for keep employee family information"""

_name = 'hr.employee.relation'
_description = 'Employee Relation Info'

name = fields.Char(string="Relationship", help="Relationship with thw employee")
2 changes: 1 addition & 1 deletion hr_gratuity_settlement/models/employee_gratuity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class EmployeeGratuity(models.Model):
('validate', 'Validated'),
('approve', 'Approved'),
('cancel', 'Cancelled')],
default='draft', track_visibility='onchange')
default='draft', tracking=True)
name = fields.Char(string='Reference', required=True, copy=False, readonly=True,
default=lambda self: _('New'))
employee_id = fields.Many2one('hr.resignation', string='Employee', required=True,
Expand Down
2 changes: 1 addition & 1 deletion hr_gratuity_settlement/models/hr_gratuity.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class EmployeeGratuity(models.Model):
('submit', 'Submitted'),
('approve', 'Approved'),
('cancel', 'Cancelled')],
default='draft', track_visibility='onchange')
default='draft', tracking=True)
name = fields.Char(string='Reference', required=True, copy=False,
readonly=True,
default=lambda self: _('New'))
Expand Down
3 changes: 2 additions & 1 deletion hr_gratuity_settlement/models/other_settlements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OtherSettlements(models.Model):
('validate', 'Validated'),
('approve', 'Approved'),
('cancel', 'Cancelled'),
], default='draft', track_visibility='onchange')
], default='draft', tracking=True)

name = fields.Char(string='Reference', required=True, copy=False, readonly=True,
default=lambda self: _('New'))
Expand Down Expand Up @@ -113,6 +113,7 @@ def draft_function(self):

class SettlementReason(models.Model):
_name = 'settlement.reason'
_description = 'Settlement Reason'
_rec_name = 'settlement_reason'


Expand Down
1 change: 1 addition & 0 deletions hr_insurance/models/policy_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class InsurancePolicy(models.Model):
_name = 'insurance.policy'
_description = 'Insurance Policy'

name = fields.Char(string='Name', required=True)
note_field = fields.Html(string='Comment', help="Notes for the insurance policy if any")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed hr_multi_company/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed hr_reminder/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed hr_reminder/models/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions hr_reminder/models/hr_reminder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class HrPopupReminder(models.Model):
_name = 'hr.reminder'
_description = 'HR Popup Reminder'

name = fields.Char(string='Title', required=True)
model_name = fields.Many2one('ir.model', help="Choose the model name", string="Model", required=True, ondelete='cascade', domain="[('model', 'like','hr')]")
Expand Down
Binary file removed hr_resignation/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 4 additions & 3 deletions hr_resignation/models/hr_resignation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class HrResignation(models.Model):
_name = 'hr.resignation'
_description = 'HR Resignation'
_inherit = 'mail.thread'
_rec_name = 'employee_id'

Expand All @@ -22,10 +23,10 @@ class HrResignation(models.Model):
help='Department of the employee')
resign_confirm_date = fields.Date(string="Confirmed Date",
help='Date on which the request is confirmed by the employee.',
track_visibility="always")
tracking=True)
approved_revealing_date = fields.Date(string="Approved Last Day Of Employee",
help='Date on which the request is confirmed by the manager.',
track_visibility="always")
tracking=True)
joined_date = fields.Date(string="Join Date", store=True,
help='Joining date of the employee.i.e Start date of the first contract')

Expand All @@ -35,7 +36,7 @@ class HrResignation(models.Model):
notice_period = fields.Char(string="Notice Period")
state = fields.Selection(
[('draft', 'Draft'), ('confirm', 'Confirm'), ('approved', 'Approved'), ('cancel', 'Rejected')],
string='Status', default='draft', track_visibility="always")
string='Status', default='draft', tracking=True)
resignation_type = fields.Selection(selection=RESIGNATION_TYPE, help="Select the type of resignation: normal "
"resignation or fired by the company")
read_only = fields.Boolean(string="check field")
Expand Down
Binary file removed hr_reward_warning/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion hr_reward_warning/models/hr_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HrAnnouncementTable(models.Model):
state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'),
('approved', 'Approved'), ('rejected', 'Refused'), ('expired', 'Expired')],
string='Status', default='draft',
track_visibility='always')
tracking=True)
requested_date = fields.Date(string='Requested Date', default=datetime.now().strftime('%Y-%m-%d'),
help="Create Date of Record")
attachment_id = fields.Many2many('ir.attachment', 'doc_warning_rel', 'doc_id', 'attach_id4',
Expand Down
1 change: 1 addition & 0 deletions hr_vacation_mngmt/models/hr_employee_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class HrFlightTicket(models.Model):
_name = 'hr.flight.ticket'
_description = 'HR Flight Ticket'

name = fields.Char()
employee_id = fields.Many2one('hr.leave', string='Employee', required=True, help="Employee")
Expand Down
1 change: 1 addition & 0 deletions hr_vacation_mngmt/models/hr_vacation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def send_leave_reminder(self):

class PendingTask(models.Model):
_name = 'pending.task'
_description = 'Pending Task'

name = fields.Char(string='Task', required=True)
leave_id = fields.Many2one('hr.leave', string='Leave Request', help="Leave request")
Expand Down
1 change: 1 addition & 0 deletions hr_vacation_mngmt/wizard/reassign_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class ReAssignTask(models.TransientModel):
_name = 'task.reassign'
_description = 'ReAssign Task'

pending_tasks = fields.One2many('pending.task', related='leave_req_id.pending_tasks', string='Pending Tasks', readonly=False)
leave_req_id = fields.Many2one('hr.leave', string='Leave Request')
Expand Down
1 change: 1 addition & 0 deletions hrms_dashboard/report/broadfactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def init(self):

class ReportOverdue(models.AbstractModel):
_name = 'report.hrms_dashboard.report_broadfactor'
_description = 'Report Overdue'

@api.model
def get_report_values(self, docids=None, data=None):
Expand Down
2 changes: 1 addition & 1 deletion oh_appraisal/models/hr_appraisal_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _default_stage_id(self):
tot_comp_survey = fields.Integer(string="Count Answers", compute="_compute_completed_survey")
tot_sent_survey = fields.Integer(string="Count Sent Questions")
created_by = fields.Many2one('res.users', string="Created By", default=lambda self: self.env.uid)
state = fields.Many2one('hr.appraisal.stages', string='Stage', track_visibility='onchange', index=True,
state = fields.Many2one('hr.appraisal.stages', string='Stage', tracking=True, index=True,
default=lambda self: self._default_stage_id(),
group_expand='_read_group_stage_ids')
# for coloring the kanban box
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions oh_employee_documents_expiry/models/document_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

class DocumentType(models.Model):
_name = 'document.type'
_description = 'Document Type'

name = fields.Char(string="Name", required=True, help="Name")
10 changes: 5 additions & 5 deletions oh_hr_lawsuit_management/models/legal_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def set_party2(self):
states={'draft': [('readonly', False)]})
hearing_date = fields.Date(string='Hearing Date',
help='Upcoming hearing date')
court_name = fields.Char(string='Court Name', track_visibility='always',
court_name = fields.Char(string='Court Name', tracking=True,
states={'won': [('readonly', True)]},
help='Name of the Court')
judge = fields.Char(string='Judge', track_visibility='always', states={'won': [('readonly', True)]},
judge = fields.Char(string='Judge', tracking=True, states={'won': [('readonly', True)]},
help='Name of the Judge')
lawyer = fields.Many2one('res.partner', string='Lawyer', track_visibility='always',
lawyer = fields.Many2one('res.partner', string='Lawyer', tracking=True,
help='Choose the contact of Layer from the contact list',
states={'won': [('readonly', True)]})
party1 = fields.Many2one('res.company', string='Party 1', required=1, readonly=1,
Expand All @@ -69,14 +69,14 @@ def set_party2(self):
help='Choose the partner')
other_name = fields.Char(string='Name', help='Enter the details of other type')
party2_name = fields.Char(compute='set_party2', string='Name', store=True)
case_details = fields.Html(string='Case Details', copy=False, track_visibility='always',
case_details = fields.Html(string='Case Details', copy=False, tracking=True,
help='More details of the case')
state = fields.Selection([('draft', 'Draft'),
('running', 'Running'),
('cancel', 'Cancelled'),
('fail', 'Failed'),
('won', 'Won')], string='Status',
default='draft', track_visibility='always', copy=False,
default='draft', tracking=True, copy=False,
help='Status')


Expand Down
2 changes: 2 additions & 0 deletions oh_hr_zk_attendance/models/machine_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class HrEmployee(models.Model):

class ZkMachine(models.Model):
_name = 'zk.machine.attendance'
_description = 'ZK Machine Attendance'
_inherit = 'hr.attendance'

@api.constrains('check_in', 'check_out', 'employee_id')
Expand Down Expand Up @@ -39,6 +40,7 @@ def _check_validity(self):

class ReportZkDevice(models.Model):
_name = 'zk.report.daily.attendance'
_description = 'Report ZK Device'
_auto = False
_order = 'punching_day desc'

Expand Down
1 change: 1 addition & 0 deletions oh_hr_zk_attendance/models/zk_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class HrAttendance(models.Model):

class ZkMachine(models.Model):
_name = 'zk.machine'
_description = 'ZK Machine'

name = fields.Char(string='Machine IP', required=True)
port_no = fields.Integer(string='Port No', required=True)
Expand Down
6 changes: 4 additions & 2 deletions ohrms_holidays_approval/models/leave_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class HrLeave(models.Model):
leave_approvals = fields.One2many('leave.validation.status',
'holiday_status',
string='Leave Validators',
track_visibility='always',
tracking=True,
help="Leave approvals")
multi_level_validation = fields.Boolean(
string='Multiple Level Approval',
Expand Down Expand Up @@ -206,6 +206,7 @@ def enable_multi_level_validation(self):
class HrLeaveValidators(models.Model):
""" Model for leave validators in Leave Types configuration """
_name = 'hr.holidays.validators'
_description = 'HR Leave Validators'

hr_holiday_status = fields.Many2one('hr.leave.type')

Expand All @@ -218,6 +219,7 @@ class HrLeaveValidators(models.Model):
class LeaveValidationStatus(models.Model):
""" Model for leave validators and their status for each leave request """
_name = 'leave.validation.status'
_description = 'Leave Validation Status'

holiday_status = fields.Many2one('hr.leave')

Expand All @@ -226,7 +228,7 @@ class LeaveValidationStatus(models.Model):
domain="[('share','=',False)]")
validation_status = fields.Boolean(string='Approve Status', readonly=True,
default=False,
track_visibility='always', help="Status")
tracking=True, help="Status")
leave_comments = fields.Text(string='Comments', help="Comments")

@api.onchange('validating_users')
Expand Down
Binary file removed ohrms_loan/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed ohrms_loan/models/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed ohrms_loan/models/__pycache__/hr_loan.cpython-36.pyc
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion ohrms_loan/models/hr_loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _compute_loan_amount(self):
('approve', 'Approved'),
('refuse', 'Refused'),
('cancel', 'Canceled'),
], string="State", default='draft', track_visibility='onchange', copy=False, )
], string="State", default='draft', tracking=True, copy=False, )

@api.model
def create(self, values):
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion ohrms_loan_accounting/models/hr_loan_acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HrLoanAcc(models.Model):
('approve', 'Approved'),
('refuse', 'Refused'),
('cancel', 'Canceled'),
], string="State", default='draft', track_visibility='onchange', copy=False, )
], string="State", default='draft', tracking=True, copy=False, )

def action_approve(self):
"""This create account move for request.
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading