Merge pull request #61 from expsa/fix_e34

fixed
This commit is contained in:
mohammed-alkhazrji 2025-12-12 02:19:31 +03:00 committed by GitHub
commit 4f24dd46ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 8 deletions

View File

@ -127,7 +127,7 @@
</xpath>
<xpath expr="//page[5]" position="replace">
<page string="Inputs" invisible="1">
<field name="input_ids" mode="tree">
<field name="input_ids" mode="list">
<list string="Input Data" editable="bottom">
<field name="name"/>
<field name="code"/>

View File

@ -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"

View File

@ -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')

View File

@ -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)

View File

@ -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)):