diff --git a/exp_payroll_custom/views/hr_salary_rules.xml b/exp_payroll_custom/views/hr_salary_rules.xml index 28909c6..15511c0 100644 --- a/exp_payroll_custom/views/hr_salary_rules.xml +++ b/exp_payroll_custom/views/hr_salary_rules.xml @@ -127,7 +127,7 @@ - + diff --git a/hr_base/models/employee_iqama_renewal.py b/hr_base/models/employee_iqama_renewal.py index f39a314..9a27863 100644 --- a/hr_base/models/employee_iqama_renewal.py +++ b/hr_base/models/employee_iqama_renewal.py @@ -4,7 +4,7 @@ from datetime import datetime as dt from odoo import _, api, exceptions, fields, models - +from odoo.exceptions import UserError class EmployeeIqamaRenew(models.Model): _name = "employee.iqama.renewal" _description = "Employee Iqama Renewal" diff --git a/hr_base/models/hr_base.py b/hr_base/models/hr_base.py index a6f542a..f2f449a 100644 --- a/hr_base/models/hr_base.py +++ b/hr_base/models/hr_base.py @@ -293,11 +293,13 @@ class HrEmployee(models.Model): def name_search(self, name='', args=None, operator='ilike', limit=100): if operator not in ('ilike', 'like', '=', '=like', '=ilike') or not name: return super(HrEmployee, self).name_search(name, args, operator, limit) + args = args or [] # add emp no in search - domain = ['|',('emp_no', operator, name),('name', operator, name)] + domain = ['|', ('emp_no', operator, name), ('name', operator, name)] recs = self.search(domain + args, limit=limit) - return recs.name_get() + + return [(rec.id, rec.display_name) for rec in recs] @api.depends('saudi_number','iqama_number','check_nationality') diff --git a/hr_holidays_community/models/hr_holidays.py b/hr_holidays_community/models/hr_holidays.py index 33a3128..7438ff8 100644 --- a/hr_holidays_community/models/hr_holidays.py +++ b/hr_holidays_community/models/hr_holidays.py @@ -170,7 +170,7 @@ class Holidays(models.Model): ('refuse', 'Refused'), ('validate1', 'Second Approval'), ('validate', 'Approved') - ], string='Status', readonly=True, tracking=True, copy=False, default='confirm', + ], string='Status', readonly=True, tracking=True, copy=False, default='draft', help="The status is set to 'To Submit', when a leave request is created." + "\nThe status is 'To Approve', when leave request is confirmed by user." + "\nThe status is 'Refused', when leave request is refused by manager." + @@ -182,7 +182,7 @@ class Holidays(models.Model): compute_sudo=True, store=True, readonly=True) date_from = fields.Datetime('Start Date', readonly=True, index=True, copy=False, tracking=True) date_to = fields.Datetime('End Date', readonly=True, copy=False, tracking=True) - holiday_status_id = fields.Many2one("hr.holidays.status", string="Leave Type", required=True, readonly=True) + holiday_status_id = fields.Many2one("hr.holidays.status", string="Leave Type", required=True,) employee_id = fields.Many2one('hr.employee', string='Employee', index=True, readonly=True, default=_default_employee, tracking=True) manager_id = fields.Many2one('hr.employee', string='Manager', readonly=True) diff --git a/hr_holidays_public/models/hr_holidays.py b/hr_holidays_public/models/hr_holidays.py index 02bbbdd..d0248b1 100644 --- a/hr_holidays_public/models/hr_holidays.py +++ b/hr_holidays_public/models/hr_holidays.py @@ -2071,8 +2071,8 @@ class holidaysAttach(models.Model): require_employee = True # For related models, check if we can write to the model, as unlinking # and creating attachments can be seen as an update to the model - records.check_access_rights('write' if mode in ('create', 'unlink') else mode) - records.check_access_rule(mode) + records.check_access('write' if mode in ('create', 'unlink') else mode) + records.check_access(mode) if require_employee: if not (self.env.user._is_admin() or self.env.user.has_group('base.group_user') or self._context.get('bypass_check_public_holidays', False)):