Merge branch 'dev_odex25_hr' into hr_change_title
This commit is contained in:
commit
fe1558461c
|
|
@ -8,27 +8,28 @@ on:
|
|||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- Cyber-Security-Project
|
||||
# - Cyber-Security-Project
|
||||
- Ensan-Project
|
||||
- Helpdesk-Khabir-Project
|
||||
- King-AbdelAziz-Library-Project
|
||||
- Twahod-Project
|
||||
- Ekram-Project
|
||||
- Sahli-Project
|
||||
|
||||
jobs:
|
||||
# Cyber Project
|
||||
cyber_master_server:
|
||||
name: Deploy to Cyber Master
|
||||
runs-on: cyber-client-project-runner
|
||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'Cyber-Security-Project' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
run: |
|
||||
echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}"
|
||||
mkdir -p ~/master_branch_sha
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${{ github.sha }}" >> ~/master_branch_sha/${GITHUB_REF#refs/heads/}
|
||||
sudo chmod +x ${{ secrets.CYBER_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh
|
||||
sudo ${{ secrets.CYBER_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.CYBER_PROJECT_USER }} ${{ secrets.CYBER_STANDARD_FOLDER_PATH }} ${{ secrets.CYBER_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} ${{ secrets.GH_TOKEN }}
|
||||
# cyber_master_server:
|
||||
# name: Deploy to Cyber Master
|
||||
# runs-on: cyber-client-project-runner
|
||||
# if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'Cyber-Security-Project' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan')
|
||||
# steps:
|
||||
# - name: Checkout And Restart Project
|
||||
# run: |
|
||||
# echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}"
|
||||
# mkdir -p ~/master_branch_sha
|
||||
# echo "$(date '+%Y-%m-%d %H:%M:%S') - ${{ github.sha }}" >> ~/master_branch_sha/${GITHUB_REF#refs/heads/}
|
||||
# sudo chmod +x ${{ secrets.CYBER_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh
|
||||
# sudo ${{ secrets.CYBER_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.CYBER_PROJECT_USER }} ${{ secrets.CYBER_STANDARD_FOLDER_PATH }} ${{ secrets.CYBER_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} ${{ secrets.GH_TOKEN }}
|
||||
|
||||
# Ensan Project
|
||||
ensan_master_server:
|
||||
|
|
@ -101,4 +102,18 @@ jobs:
|
|||
sudo chmod +x ${{ secrets.EKRAM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh
|
||||
sudo ${{ secrets.EKRAM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.EKRAM_PROJECT_USER }} ${{ secrets.EKRAM_STANDARD_FOLDER_PATH }} ${{ secrets.EKRAM_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} ${{ secrets.GH_TOKEN }}
|
||||
|
||||
# Sahli Prod project
|
||||
sahli_prod_master_server:
|
||||
name: Deploy to Sahli Prod Master
|
||||
runs-on: sahli-client-project-runner
|
||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'Sahli-Project' && (github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_project')
|
||||
steps:
|
||||
- name: Checkout And Restart Project
|
||||
run: |
|
||||
echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}"
|
||||
mkdir -p ~/master_branch_sha
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${{ github.sha }}" >> ~/master_branch_sha/${GITHUB_REF#refs/heads/}
|
||||
sudo chmod +x ${{ secrets.SAHLI_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh
|
||||
sudo ${{ secrets.SAHLI_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.SAHLI_PROJECT_USER }} ${{ secrets.SAHLI_STANDARD_FOLDER_PATH }} ${{ secrets.SAHLI_PROD_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} ${{ secrets.GH_TOKEN }}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@ msgstr "نسيان البصمة"
|
|||
msgid "Absent Report"
|
||||
msgstr ""
|
||||
|
||||
|
||||
#. module: attendances
|
||||
#: model_terms:ir.ui.view,arch_db:attendances.resource_calendar_inherited_form
|
||||
msgid "Account Overtime"
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ class HrAttendanceReport(models.Model):
|
|||
'delay': 0.0,
|
||||
'leave': leaves,
|
||||
'additional_hours': 0.0,
|
||||
'exists': 0.0,
|
||||
'exist_hours': 0.0,
|
||||
'extra_break_duration': 0.0,
|
||||
'absent': actual_absent_hours + missing_punch_hours + break_hours + early_exit_hours + lateness_hours ,
|
||||
'mission_by_days': total_mission,
|
||||
|
|
@ -325,7 +325,7 @@ class HrAttendanceReport(models.Model):
|
|||
'employee_name': attendance.employee_id.id,
|
||||
'delay': lateness,
|
||||
'leave': total_leaves,
|
||||
'exists': early_exist,
|
||||
'exist_hours': early_exist,
|
||||
'extra_break_duration': extra_break_duration,
|
||||
'absent': actual_absent_hours + missing_punch_hours + lateness + early_exist + extra_break_duration,
|
||||
'mission_by_days': total_mission_by_day,
|
||||
|
|
@ -358,7 +358,7 @@ class HrAttendanceReport(models.Model):
|
|||
temp_dict["leave"] = sum(item1["leave"] for item1 in grp2)
|
||||
temp_dict["mission_by_days"] = sum(item1["mission_by_days"] for item1 in grp14)
|
||||
temp_dict["absent"] = sum(item1["absent"] for item1 in grp3)
|
||||
temp_dict["exists"] = sum(item1["exists"] for item1 in grp4)
|
||||
temp_dict["exist_hours"] = sum(item1["exist_hours"] for item1 in grp4)
|
||||
temp_dict["extra_break_duration"] = sum(item1["extra_break_duration"] for item1 in grp5)
|
||||
temp_dict["absent_days_by_hr"] = sum(item1["absent_days_by_hr"] for item1 in grp6)
|
||||
temp_dict["total_hours"] = sum(item["total_hours"] for item in grp7) - (
|
||||
|
|
@ -418,7 +418,7 @@ class HrAttendanceReport(models.Model):
|
|||
'delay': sum_line.delay + sum(sum_recs.mapped('line_ids.delay')),
|
||||
'leave': sum_line.leave + sum(sum_recs.mapped('line_ids.leave')),
|
||||
'absent': sum_line.absent + sum(sum_recs.mapped('line_ids.absent')),
|
||||
'exists': sum_line.exists + sum(sum_recs.mapped('line_ids.exists')),
|
||||
'exist_hours': sum_line.exists + sum(sum_recs.mapped('line_ids.exist_hours')),
|
||||
'total_hours': sum_line.total_hours + sum(sum_recs.mapped('line_ids.total_hours')),
|
||||
'dummy_field': sum_line.dummy_field + sum(sum_recs.mapped('line_ids.dummy_field')),
|
||||
'total_deduction': sum_line.total_deduction + sum(sum_recs.mapped('line_ids.total_deduction')),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class HrAttendanceReportLine(models.Model):
|
|||
employee_name = fields.Many2one(comodel_name='hr.employee')
|
||||
delay = fields.Float()
|
||||
leave = fields.Float(string='Holiday Hours')
|
||||
exists = fields.Float()
|
||||
exist_hours = fields.Float()
|
||||
extra_break_duration = fields.Float()
|
||||
absent = fields.Float(string='Absent Hours')
|
||||
mission_by_days = fields.Float(string='Mission Hours')
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
<tree editable="bottom" decoration-danger="total_deduction > 0">
|
||||
<field name="employee_name" string="Employee Name" readonly="1"/>
|
||||
<field name="delay" string="Delay" widget="float_time" readonly="1" sum="Total:"/>
|
||||
<field name="exists" string="Early Exist" widget="float_time" readonly="1" sum="Total:"/>
|
||||
<field name="exist_hours" string="Early Exist" widget="float_time" readonly="1" sum="Total:"/>
|
||||
<field name="total_permission_hours" string="Permission Hours" widget="float_time" readonly="1" sum="Total:" optional="show"/>
|
||||
<field name="actual_absent_hours" string="Actual Absent Hours" widget="float_time" readonly="1" sum="Total:" />
|
||||
<field name="missing_punch_hours" string="Missing Punch Hours" widget="float_time" readonly="1" sum="Total:" />
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
<field name="employee_name" string="Employee Name"/>
|
||||
<field name="delay" string="Delay" widget="float_time"/>
|
||||
<field name="leave" string="Leave" widget="float_time"/>
|
||||
<field name="exists" string="Early Exist" widget="float_time"/>
|
||||
<field name="exist_hours" string="Early Exist" widget="float_time"/>
|
||||
<field name="total_permission_hours" string="Permission Hours" widget="float_time"/>
|
||||
<field name="actual_absent_hours" string="Actual Absent Hours" widget="float_time"/>
|
||||
<field name="missing_punch_hours" string="Missing Punch Hours" widget="float_time"/>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
'views/ticket_view.xml',
|
||||
'views/course_view.xml',
|
||||
'views/appraisal_view.xml',
|
||||
# 'views/res_partner_form_view.xml',
|
||||
'views/training_menus.xml',
|
||||
'wizard/employee_selection_wizard.xml',
|
||||
'wizard/training_appraisal.xml',
|
||||
|
|
|
|||
|
|
@ -2135,6 +2135,20 @@ msgstr ""
|
|||
msgid "name"
|
||||
msgstr "الاسم"
|
||||
|
||||
#. module: exp_official_mission
|
||||
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
|
||||
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
|
||||
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
|
||||
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
|
||||
#, python-format
|
||||
msgid "Company working calendar is not configured."
|
||||
msgstr "لم يتم ضبط تقويم عمل الشركة."
|
||||
|
||||
#. module: exp_official_mission
|
||||
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_official_mission_type__working_days
|
||||
msgid "Working Days Only"
|
||||
msgstr "أيام عمل فقط"
|
||||
|
||||
#. module: exp_official_mission
|
||||
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
|
||||
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
|
||||
|
|
@ -2776,4 +2790,4 @@ msgstr "الموارد البشرية"
|
|||
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_official_mission_type__analytic_account_id
|
||||
#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_official_mission_type_form_view
|
||||
msgid "Analytic Account"
|
||||
msgstr "الحساب التحليلي"
|
||||
msgstr "الحساب التحليلي"
|
||||
|
|
@ -8,3 +8,10 @@ class AttendanceTransactions(models.Model):
|
|||
official_id = fields.Many2one('hr.official.mission', string='Mission Request')
|
||||
total_mission_hours = fields.Float()
|
||||
mission_name = fields.Many2one(related='official_id.mission_type', string='Mission Type', store=True)
|
||||
|
||||
|
||||
|
||||
# class ResPartner(models.Model):
|
||||
# _inherit = 'res.partner'
|
||||
#
|
||||
# training = fields.Boolean(string="Training",default=True)
|
||||
|
|
@ -88,13 +88,14 @@ class HrOfficialMission(models.Model):
|
|||
|
||||
employee_id = fields.Many2one('hr.employee', 'Responsible', default=lambda item: item.get_user_id(),
|
||||
domain=[('state', '=', 'open')])
|
||||
employee_no = fields.Char(related='employee_id.emp_no', readonly=True,string='Employee Number', store=True)
|
||||
employee_no = fields.Char(related='employee_id.emp_no', readonly=True, string='Employee Number', store=True)
|
||||
reference = fields.Char(string="Reference Number")
|
||||
|
||||
company_id = fields.Many2one('res.company',string="Company", default=lambda self: self.env.user.company_id)
|
||||
company_id = fields.Many2one('res.company', string="Company", default=lambda self: self.env.user.company_id)
|
||||
|
||||
ticket_request_id = fields.Many2one('hr.ticket.request', string="Ticket Request", readonly=True)
|
||||
department_id2 = fields.Many2one(related='employee_id.department_id', readonly=True,store=True,string='Department')
|
||||
department_id2 = fields.Many2one(related='employee_id.department_id', readonly=True, store=True,
|
||||
string='Department')
|
||||
is_branch = fields.Many2one(related='department_id2.branch_name', store=True, readonly=True)
|
||||
attachment_count = fields.Integer(string="Attachments", compute="_compute_attachment_count")
|
||||
training_details = fields.Html('Training Details')
|
||||
|
|
@ -102,6 +103,7 @@ class HrOfficialMission(models.Model):
|
|||
appraisal_count = fields.Integer(string="Appraisals", compute="get_employees_appraisal")
|
||||
hr_nomination = fields.Boolean(string="HR Nomination")
|
||||
|
||||
|
||||
@api.onchange('hour_duration', 'date_duration')
|
||||
def compute_number_of_hours(self):
|
||||
for item in self:
|
||||
|
|
@ -110,7 +112,8 @@ class HrOfficialMission(models.Model):
|
|||
|
||||
|
||||
|
||||
'''@api.constrains('employee_ids')
|
||||
|
||||
@api.constrains('employee_ids')
|
||||
def chick_employee_ids(self):
|
||||
for item in self:
|
||||
if not item.employee_ids:
|
||||
|
|
@ -138,16 +141,17 @@ class HrOfficialMission(models.Model):
|
|||
#########################################
|
||||
|
||||
def _compute_attachment_count(self):
|
||||
attachment_data = self.env['ir.attachment'].read_group([('res_model', '=', 'hr.official.mission'), ('res_id', 'in', self.ids)], ['res_id'], ['res_id'])
|
||||
attachment_data = self.env['ir.attachment'].read_group(
|
||||
[('res_model', '=', 'hr.official.mission'), ('res_id', 'in', self.ids)], ['res_id'], ['res_id'])
|
||||
attachment = dict((data['res_id'], data['res_id_count']) for data in attachment_data)
|
||||
for rec in self:
|
||||
rec.attachment_count = attachment.get(rec.id, 0)+sum(rec.employee_ids.mapped('attachment_count'))
|
||||
rec.attachment_count = attachment.get(rec.id, 0) + sum(rec.employee_ids.mapped('attachment_count'))
|
||||
|
||||
def action_get_attachment_view(self):
|
||||
res = self.env['ir.actions.act_window']._for_xml_id('base.action_attachment')
|
||||
related_ids = self.ids + self.employee_ids.ids
|
||||
related_models = ['hr.official.mission', 'hr.official.mission.employee']
|
||||
res['domain'] = [('res_model', 'in', related_models) ,('res_id', 'in', related_ids)]
|
||||
res['domain'] = [('res_model', 'in', related_models), ('res_id', 'in', related_ids)]
|
||||
res['context'] = {
|
||||
'default_res_model': 'hr.official.mission',
|
||||
'default_res_id': self.id,
|
||||
|
|
@ -169,7 +173,6 @@ class HrOfficialMission(models.Model):
|
|||
else:
|
||||
ctx['default_official_mission_id'] = self.id
|
||||
|
||||
|
||||
ctx['default_employee_id'] = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1)
|
||||
|
||||
return {
|
||||
|
|
@ -202,7 +205,6 @@ class HrOfficialMission(models.Model):
|
|||
[('employee_id', 'in', employee_ids.ids), ('mission_id', '=', rec.id)])
|
||||
rec.appraisal_count = len(training)
|
||||
|
||||
|
||||
def action_employees_appraisal(self):
|
||||
employee_ids = self.employee_ids.mapped('employee_id')
|
||||
training = self.env['hr.employee.appraisal'].search(
|
||||
|
|
@ -218,14 +220,12 @@ class HrOfficialMission(models.Model):
|
|||
'context': {}
|
||||
}
|
||||
|
||||
|
||||
def check_appraisal(self):
|
||||
if all(record.appraisal_id for record in self.employee_ids):
|
||||
if all(record.appraisal_id for record in self.employee_ids):
|
||||
self.appraisal_found = True
|
||||
else:
|
||||
self.appraisal_found = False
|
||||
|
||||
|
||||
def get_user_id(self):
|
||||
employee_id = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1)
|
||||
if employee_id:
|
||||
|
|
@ -261,7 +261,8 @@ class HrOfficialMission(models.Model):
|
|||
raise exceptions.Warning(
|
||||
_('Employee %s, The course does not follow the career record') % emp.employee_id.name)
|
||||
|
||||
@api.onchange('date_from', 'date_to', 'hour_to', 'hour_from', 'mission_type', 'state','table_ids')
|
||||
|
||||
@api.onchange('date_from', 'date_to', 'hour_to', 'hour_from', 'mission_type','mission_type.working_days', 'state','table_ids')
|
||||
def _get_mission_no(self):
|
||||
for item in self:
|
||||
|
||||
|
|
@ -275,12 +276,30 @@ class HrOfficialMission(models.Model):
|
|||
end_mission_date = datetime.strptime(str(item.date_to), "%Y-%m-%d")
|
||||
|
||||
if end_mission_date >= start_mission_date:
|
||||
|
||||
if not item.table_ids:
|
||||
days = (end_mission_date - start_mission_date).days
|
||||
item.date_duration = days + 1
|
||||
else:
|
||||
unique_dates = set(item.table_ids.mapped('date'))
|
||||
item.date_duration = len(unique_dates)
|
||||
|
||||
# days = (end_mission_date - start_mission_date).days
|
||||
# item.date_duration = days + 1
|
||||
date_range = [start_mission_date.date() + timedelta(days=i)
|
||||
for i in range((end_mission_date - start_mission_date).days + 1)]
|
||||
|
||||
if item.mission_type.working_days:
|
||||
calendar = item.company_id.resource_calendar_id
|
||||
if not calendar:
|
||||
raise ValidationError(_('Company working calendar is not configured.'))
|
||||
|
||||
weekend_days = calendar.full_day_off or calendar.shift_day_off
|
||||
weekend_names = [d.name.lower() for d in weekend_days]
|
||||
date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names]
|
||||
|
||||
item.date_duration = len(date_range)
|
||||
|
||||
else:
|
||||
# item.duration = 0.0
|
||||
raise exceptions.Warning(_('Date Form Must Be Less than Date To'))
|
||||
|
|
@ -300,7 +319,7 @@ class HrOfficialMission(models.Model):
|
|||
if item.hour_to > item.hour_from:
|
||||
item.hour_duration = (item.hour_to - item.hour_from)
|
||||
else:
|
||||
item.hour_duration = (24 -item.hour_from ) + item.hour_to
|
||||
item.hour_duration = (24 - item.hour_from) + item.hour_to
|
||||
|
||||
# raise exceptions.Warning(_('Hour to must be greater than hour from.'))
|
||||
if item.mission_type.maximum_hours > 0.0:
|
||||
|
|
@ -325,8 +344,22 @@ class HrOfficialMission(models.Model):
|
|||
raise exceptions.Warning(_('date form must be less than date to'))
|
||||
|
||||
else:
|
||||
dayss = (leave_to - leave_from).days
|
||||
line.days = dayss + 1
|
||||
# dayss = (leave_to - leave_from).days
|
||||
# line.days = dayss + 1
|
||||
date_range = [leave_from.date() + timedelta(days=i)
|
||||
for i in range((leave_to - leave_from).days + 1)]
|
||||
|
||||
if item.mission_type.working_days:
|
||||
calendar = item.company_id.resource_calendar_id
|
||||
if not calendar:
|
||||
raise ValidationError(_('Company working calendar is not configured.'))
|
||||
|
||||
weekend_days = calendar.full_day_off or calendar.shift_day_off
|
||||
weekend_names = [d.name.lower() for d in weekend_days]
|
||||
date_range = [d for d in date_range if
|
||||
d.strftime('%A').lower() not in weekend_names]
|
||||
|
||||
line.days = len(date_range)
|
||||
if item.mission_type.related_with_financial is True:
|
||||
if item.mission_type.type_of_payment == 'fixed':
|
||||
if item.mission_type.day_price:
|
||||
|
|
@ -338,7 +371,8 @@ class HrOfficialMission(models.Model):
|
|||
if item.mission_type.allowance_id:
|
||||
for rule in item.mission_type.allowance_id:
|
||||
if line.employee_id:
|
||||
total += item.compute_rule(rule, line.sudo().employee_id.contract_id)
|
||||
total += item.compute_rule(rule,
|
||||
line.sudo().employee_id.contract_id)
|
||||
line.day_price = total
|
||||
line.amount = total * line.days
|
||||
|
||||
|
|
@ -439,14 +473,13 @@ class HrOfficialMission(models.Model):
|
|||
raise exceptions.Warning(_(
|
||||
'You can not re-draft official mission because Appraisal with ID "%s" in not draft state ') % line.appraisal_id.employee_id.name)
|
||||
|
||||
|
||||
item.state = 'draft'
|
||||
self.reset_emp_work_state()
|
||||
self.call_cron_function()
|
||||
|
||||
def call_cron_function(self):
|
||||
transaction = self.env['hr.attendance.transaction']
|
||||
#if self.duration_type == 'days':
|
||||
# if self.duration_type == 'days':
|
||||
if self.duration_type:
|
||||
if self.date_to and self.date_from:
|
||||
start_date = datetime.strptime(str(self.date_from), '%Y-%m-%d')
|
||||
|
|
@ -457,12 +490,12 @@ class HrOfficialMission(models.Model):
|
|||
for i in range(delta.days + 1):
|
||||
day = start_date + timedelta(days=i)
|
||||
if today >= day.date():
|
||||
transaction.process_attendance_scheduler_queue(day, self.employee_ids.mapped(
|
||||
'employee_id'))
|
||||
#else:
|
||||
# day = datetime.strptime(str(self.date), '%Y-%m-%d')
|
||||
#transaction.process_attendance_scheduler_queue(day, self.employee_ids.mapped(
|
||||
# 'employee_id'))
|
||||
transaction.process_attendance_scheduler_queue(day, self.employee_ids.mapped(
|
||||
'employee_id'))
|
||||
# else:
|
||||
# day = datetime.strptime(str(self.date), '%Y-%m-%d')
|
||||
# transaction.process_attendance_scheduler_queue(day, self.employee_ids.mapped(
|
||||
# 'employee_id'))
|
||||
|
||||
def send(self):
|
||||
for item in self:
|
||||
|
|
@ -483,7 +516,6 @@ class HrOfficialMission(models.Model):
|
|||
self.employee_ids.chick_not_overtime()
|
||||
self.state = "send"
|
||||
|
||||
|
||||
def send_depart_manager(self):
|
||||
for item in self:
|
||||
if not item.employee_ids:
|
||||
|
|
@ -499,7 +531,6 @@ class HrOfficialMission(models.Model):
|
|||
else:
|
||||
self.state = "send"
|
||||
|
||||
|
||||
def direct_manager(self):
|
||||
# self.chick_employee_ids()
|
||||
self.employee_ids.chick_not_overtime()
|
||||
|
|
@ -510,29 +541,29 @@ class HrOfficialMission(models.Model):
|
|||
manager = rec.sudo().employee_id.parent_id
|
||||
hr_manager = rec.sudo().employee_id.company_id.hr_manager_id
|
||||
if manager:
|
||||
if manager.user_id.id == rec.env.uid or hr_manager.user_id.id == rec.env.uid:
|
||||
rec.write({'state': 'depart_manager'})
|
||||
else:
|
||||
raise exceptions.Warning(
|
||||
_("Sorry, The Approval For The Direct Manager '%s' Only OR HR Manager!")%(manager.name))
|
||||
if manager.user_id.id == rec.env.uid or hr_manager.user_id.id == rec.env.uid:
|
||||
rec.write({'state': 'depart_manager'})
|
||||
else:
|
||||
raise exceptions.Warning(
|
||||
_("Sorry, The Approval For The Direct Manager '%s' Only OR HR Manager!") % (manager.name))
|
||||
else:
|
||||
rec.write({'state': 'depart_manager'})
|
||||
if self.mission_type.approve_by == 'direct_manager':
|
||||
self.approve()
|
||||
|
||||
#Refuse For The Direct Manager Only
|
||||
# Refuse For The Direct Manager Only
|
||||
def direct_manager_refused(self):
|
||||
for rec in self:
|
||||
manager = rec.sudo().employee_id.parent_id
|
||||
hr_manager = rec.sudo().employee_id.user_id.company_id.hr_manager_id
|
||||
if manager:
|
||||
if manager.user_id.id == rec.env.uid or hr_manager.user_id.id == rec.env.uid:
|
||||
rec.refused()
|
||||
rec.refused()
|
||||
else:
|
||||
raise exceptions.Warning(_("Sorry, The Refuse For The Direct Manager '%s' Only OR HR Manager!") % (manager.name))
|
||||
raise exceptions.Warning(
|
||||
_("Sorry, The Refuse For The Direct Manager '%s' Only OR HR Manager!") % (manager.name))
|
||||
else:
|
||||
rec.refused()
|
||||
|
||||
rec.refused()
|
||||
|
||||
def depart_manager(self):
|
||||
self.sudo().employee_ids.chick_not_overtime()
|
||||
|
|
@ -542,13 +573,14 @@ class HrOfficialMission(models.Model):
|
|||
hr_manager = rec.sudo().employee_id.user_id.company_id.hr_manager_id
|
||||
if coach:
|
||||
if coach.user_id.id == rec.env.uid or hr_manager.user_id.id == rec.env.uid:
|
||||
rec.state = 'depart_manager'
|
||||
rec.state = 'depart_manager'
|
||||
else:
|
||||
raise exceptions.Warning(
|
||||
_('Sorry, The Approval For The Department Manager %s Only OR HR Manager!') % (coach.name))
|
||||
else:
|
||||
rec.state = 'depart_manager'
|
||||
#Refuse For The Department Manager Only
|
||||
|
||||
# Refuse For The Department Manager Only
|
||||
def dep_manager_refused(self):
|
||||
self.reset_emp_work_state()
|
||||
for rec in self:
|
||||
|
|
@ -556,16 +588,17 @@ class HrOfficialMission(models.Model):
|
|||
hr_manager = rec.sudo().employee_id.user_id.company_id.hr_manager_id
|
||||
if coach:
|
||||
if coach.user_id.id == rec.env.uid or hr_manager.user_id.id == rec.env.uid:
|
||||
rec.refused()
|
||||
rec.refused()
|
||||
else:
|
||||
raise exceptions.Warning(_('Sorry, The Refuse For The Department Manager %s Only OR HR Manager') % (coach.name))
|
||||
raise exceptions.Warning(
|
||||
_('Sorry, The Refuse For The Department Manager %s Only OR HR Manager') % (coach.name))
|
||||
else:
|
||||
rec.refused()
|
||||
|
||||
def hr_aaproval(self):
|
||||
# self.chick_employee_ids()
|
||||
lines_draft_status = any(self.employee_ids.filtered(lambda emp: emp.status in ('draft','direct_manager')))
|
||||
if lines_draft_status and self.mission_type.work_state=='training':
|
||||
lines_draft_status = any(self.employee_ids.filtered(lambda emp: emp.status in ('draft', 'direct_manager')))
|
||||
if lines_draft_status and self.mission_type.work_state == 'training':
|
||||
raise ValidationError(_("You must Approve all Employees Line First."))
|
||||
|
||||
self.employee_ids.chick_not_overtime()
|
||||
|
|
@ -585,8 +618,8 @@ class HrOfficialMission(models.Model):
|
|||
if self.employee_ids and self.mission_type.related_with_financial:
|
||||
# move amounts to journal entries
|
||||
if self.move_type == 'accounting':
|
||||
#if self.mission_type.account_id and self.mission_type.journal_id:
|
||||
if self.mission_type.related_with_financial==True:
|
||||
# if self.mission_type.account_id and self.mission_type.journal_id:
|
||||
if self.mission_type.related_with_financial == True:
|
||||
for item in self.employee_ids:
|
||||
emp_type = item.employee_id.employee_type_id
|
||||
account_debit_id = self.mission_type.get_debit_mission_account_id(emp_type)
|
||||
|
|
@ -596,15 +629,17 @@ class HrOfficialMission(models.Model):
|
|||
analytic_account_id = item.employee_id.department_id.analytic_account_id
|
||||
|
||||
if not journal_id:
|
||||
raise exceptions.Warning(_('You Must Enter The Journal Name Mission Type %s.')% self.mission_type.name)
|
||||
raise exceptions.Warning(
|
||||
_('You Must Enter The Journal Name Mission Type %s.') % self.mission_type.name)
|
||||
if not account_debit_id:
|
||||
raise exceptions.Warning(_('Employee %s, The Mission %s Has No Account Setting Base On Employee Type.'
|
||||
) % (item.employee_id.name,self.mission_type.name))
|
||||
raise exceptions.Warning(
|
||||
_('Employee %s, The Mission %s Has No Account Setting Base On Employee Type.'
|
||||
) % (item.employee_id.name, self.mission_type.name))
|
||||
if item.amount > 0.0:
|
||||
debit_line_vals = {
|
||||
'name': item.employee_id.name + ' in official mission "%s" ' % self.mission_type.name,
|
||||
'debit': item.amount,
|
||||
#'account_id': self.mission_type.account_id.id,
|
||||
# 'account_id': self.mission_type.account_id.id,
|
||||
'account_id': account_debit_id.id,
|
||||
'partner_id': item.employee_id.user_id.partner_id.id,
|
||||
'analytic_account_id': analytic_account_id.id,
|
||||
|
|
@ -616,20 +651,20 @@ class HrOfficialMission(models.Model):
|
|||
'partner_id': item.employee_id.user_id.partner_id.id
|
||||
}
|
||||
if not item.account_move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': journal_id.id,
|
||||
'date': date.today(),
|
||||
'ref': 'Official mission for employee "%s" ' % item.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.official.mission',
|
||||
'res_id': self.id
|
||||
})
|
||||
# fill account move for each employee
|
||||
item.write({'account_move_id': move.id})
|
||||
#else:
|
||||
#raise exceptions.Warning(
|
||||
#_('You do not have account or journal in mission type "%s" ') % self.mission_type.name)
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': journal_id.id,
|
||||
'date': date.today(),
|
||||
'ref': 'Official mission for employee "%s" ' % item.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.official.mission',
|
||||
'res_id': self.id
|
||||
})
|
||||
# fill account move for each employee
|
||||
item.write({'account_move_id': move.id})
|
||||
# else:
|
||||
# raise exceptions.Warning(
|
||||
# _('You do not have account or journal in mission type "%s" ') % self.mission_type.name)
|
||||
|
||||
# move amounts to advantages of employee in contract
|
||||
elif self.move_type == 'payroll':
|
||||
|
|
@ -988,7 +1023,7 @@ class HrOfficialMissionType(models.Model):
|
|||
max_amount = fields.Float('Maximum Amount')
|
||||
|
||||
# relational fields
|
||||
company_id = fields.Many2one('res.company',string="Company", default=lambda self: self.env.user.company_id)
|
||||
company_id = fields.Many2one('res.company', string="Company", default=lambda self: self.env.user.company_id)
|
||||
allowance_id = fields.Many2many('hr.salary.rule')
|
||||
journal_id = fields.Many2one('account.journal')
|
||||
account_id = fields.Many2one('account.account')
|
||||
|
|
@ -1003,10 +1038,12 @@ class HrOfficialMissionType(models.Model):
|
|||
('training', _('Training')),
|
||||
('others', _('others'))], 'Work Status')
|
||||
special_hours = fields.Boolean(string='Special Hours', default=False)
|
||||
approve_by = fields.Selection([('direct_manager', 'Direct Manager'), ('depart_manager', 'HR Department')], default='direct_manager', required=True)
|
||||
approve_by = fields.Selection([('direct_manager', 'Direct Manager'), ('depart_manager', 'HR Department')],
|
||||
default='direct_manager', required=True)
|
||||
|
||||
transfer_by_emp_type = fields.Boolean('Transfer By Emp Type')
|
||||
account_ids = fields.One2many('hr.mission.type.account', 'mission_id')
|
||||
working_days = fields.Boolean(string='Working Days Only', default=False)
|
||||
|
||||
@api.onchange('duration_type')
|
||||
def _change_duration_type(self):
|
||||
|
|
@ -1023,12 +1060,13 @@ class HrOfficialMissionType(models.Model):
|
|||
raise exceptions.Warning(_('You Can Not Delete Mission Type, Because There is a Related other record'))
|
||||
return super(HrOfficialMissionType, self).unlink()
|
||||
|
||||
#get acoount IDs base on Mission Type account config
|
||||
# get acoount IDs base on Mission Type account config
|
||||
def get_debit_mission_account_id(self, emp_type):
|
||||
if not self.transfer_by_emp_type : return self.account_id
|
||||
if not self.transfer_by_emp_type: return self.account_id
|
||||
account_mapping = self.account_ids.filtered(lambda a: a.emp_type_id.id == emp_type.id)
|
||||
return account_mapping[0].debit_account_id if account_mapping else False
|
||||
|
||||
|
||||
class HrMissionTypeAccount(models.Model):
|
||||
_name = 'hr.mission.type.account'
|
||||
_description = 'Mission Type Account Mapping'
|
||||
|
|
@ -1038,7 +1076,6 @@ class HrMissionTypeAccount(models.Model):
|
|||
debit_account_id = fields.Many2one('account.account', string="Debit Account", required=True)
|
||||
|
||||
|
||||
|
||||
class HrOfficialMissionEmployee(models.Model):
|
||||
_name = 'hr.official.mission.employee'
|
||||
_rec_name = 'employee_id'
|
||||
|
|
@ -1074,15 +1111,13 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
store=True)
|
||||
attachment_count = fields.Integer(string="Attachments", compute="_compute_attachment_count")
|
||||
status = fields.Selection([('draft', _('Draft')),
|
||||
('direct_manager', _('Waiting Direct Manager')),
|
||||
('approved', _('Approved')),
|
||||
('direct_manager', _('Waiting Direct Manager')),
|
||||
('approved', _('Approved')),
|
||||
('done', _('Done')),
|
||||
('refused', _('Refused')),
|
||||
], default="draft", tracking=True)
|
||||
('refused', _('Refused')),
|
||||
], default="draft", tracking=True)
|
||||
training_details = fields.Html('Training Details', related="official_mission_id.training_details")
|
||||
|
||||
|
||||
|
||||
def approve(self):
|
||||
self.status = "approved"
|
||||
|
||||
|
|
@ -1095,15 +1130,13 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
def set_to_draft(self):
|
||||
self.status = "draft"
|
||||
|
||||
|
||||
def _compute_attachment_count(self):
|
||||
attachment_data = self.env['ir.attachment'].read_group([('res_model', '=', 'hr.official.mission.employee'), ('res_id', 'in', self.ids)], ['res_id'], ['res_id'])
|
||||
attachment_data = self.env['ir.attachment'].read_group(
|
||||
[('res_model', '=', 'hr.official.mission.employee'), ('res_id', 'in', self.ids)], ['res_id'], ['res_id'])
|
||||
attachment = dict((data['res_id'], data['res_id_count']) for data in attachment_data)
|
||||
for rec in self:
|
||||
rec.attachment_count = attachment.get(rec.id, 0)
|
||||
|
||||
|
||||
|
||||
def action_get_attachment_view(self):
|
||||
self.ensure_one()
|
||||
res = self.env['ir.actions.act_window']._for_xml_id('base.action_attachment')
|
||||
|
|
@ -1111,8 +1144,6 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
res['context'] = {'default_res_model': 'hr.official.mission.employee', 'default_res_id': self.id}
|
||||
return res
|
||||
|
||||
|
||||
|
||||
@api.constrains('date_from', 'date_to', 'hour_from', 'hour_to', 'employee_id')
|
||||
def check_dates(self):
|
||||
for rec in self:
|
||||
|
|
@ -1145,12 +1176,13 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
('official_mission_id.process_type', '=', 'training'),
|
||||
('official_mission_id.course_name.id', '=', item.official_mission_id.course_name.id)])
|
||||
if duplicated:
|
||||
raise exceptions.ValidationError(_("Employee %s has already take this course.") % (item.employee_id.name))
|
||||
raise exceptions.ValidationError(
|
||||
_("Employee %s has already take this course.") % (item.employee_id.name))
|
||||
if item.official_mission_id and item.official_mission_id.mission_type.duration_type == 'days' \
|
||||
and item.date_from and item.date_to:
|
||||
### mission related_with_financial
|
||||
financial_missions = item.env['hr.official.mission.employee'].search(
|
||||
[('official_mission_id.state', 'not in', ('draft','refuesd')),
|
||||
[('official_mission_id.state', 'not in', ('draft', 'refuesd')),
|
||||
('employee_id', '=', item.employee_id.id),
|
||||
('official_mission_id.mission_type.related_with_financial', '=', True),
|
||||
('official_mission_id.mission_type.duration_type', '=', 'days'),
|
||||
|
|
@ -1158,19 +1190,22 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
])
|
||||
days_per_year = item.official_mission_id.mission_type.max_days_year
|
||||
if days_per_year > 0.0:
|
||||
if item.days > days_per_year:
|
||||
raise exceptions.Warning(_('Sorry The Employee %s Cannot Exceed %s Days, This Maximum Days Per year.') % (
|
||||
item.employee_id.name,days_per_year))
|
||||
if item.days > days_per_year:
|
||||
raise exceptions.Warning(
|
||||
_('Sorry The Employee %s Cannot Exceed %s Days, This Maximum Days Per year.') % (
|
||||
item.employee_id.name, days_per_year))
|
||||
if financial_missions:
|
||||
if days_per_year > 0:
|
||||
number_days = item.days
|
||||
for rec in financial_missions:
|
||||
year_last_record = datetime.strptime(str(rec.date_from), '%Y-%m-%d').year
|
||||
year_now_record = datetime.strptime(str(item.date_from), '%Y-%m-%d').year
|
||||
if year_last_record == year_now_record:
|
||||
number_days = number_days + rec.days
|
||||
if number_days > days_per_year:
|
||||
raise exceptions.ValidationError(_("Sorry The Employee %s, The Number of Requests Cannot Exceed %s Maximum Days Per year.") % (rec.employee_id.name,days_per_year))
|
||||
if days_per_year > 0:
|
||||
number_days = item.days
|
||||
for rec in financial_missions:
|
||||
year_last_record = datetime.strptime(str(rec.date_from), '%Y-%m-%d').year
|
||||
year_now_record = datetime.strptime(str(item.date_from), '%Y-%m-%d').year
|
||||
if year_last_record == year_now_record:
|
||||
number_days = number_days + rec.days
|
||||
if number_days > days_per_year:
|
||||
raise exceptions.ValidationError(
|
||||
_("Sorry The Employee %s, The Number of Requests Cannot Exceed %s Maximum Days Per year.") % (
|
||||
rec.employee_id.name, days_per_year))
|
||||
####
|
||||
|
||||
prev_missions = item.env['hr.official.mission.employee'].search(
|
||||
|
|
@ -1211,7 +1246,8 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
raise exceptions.Warning(
|
||||
_('Sorry the maximum Amount allow for %s is %s and employee %s has Greater than '
|
||||
'Maximum Amount.')
|
||||
% (item.official_mission_id.mission_type.name, item.official_mission_id.mission_type.max_amount,
|
||||
% (item.official_mission_id.mission_type.name,
|
||||
item.official_mission_id.mission_type.max_amount,
|
||||
item.employee_id.name))
|
||||
Module = self.env['ir.module.module'].sudo()
|
||||
modules_permission = Module.search([('state', '=', 'installed'), ('name', '=', 'employee_requests')])
|
||||
|
|
@ -1222,7 +1258,8 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
if date_to and date_from:
|
||||
delta = timedelta(days=1)
|
||||
while date_from <= date_to:
|
||||
clause_1, clause_2, clause_3 = item.get_permission_domain(str(date_from), str(date_from))
|
||||
clause_1, clause_2, clause_3 = item.get_permission_domain(str(date_from),
|
||||
str(date_from))
|
||||
clause_final = [('employee_id', '=', item.employee_id.id), ('state', '!=', 'refused'),
|
||||
'|', '|'] + clause_1 + clause_2 + clause_3
|
||||
permissions = self.env['hr.personal.permission'].search(clause_final)
|
||||
|
|
@ -1300,7 +1337,19 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
leave_to_1 = datetime.strptime(str(item.date_to), "%Y-%m-%d")
|
||||
leave_from_1 = datetime.strptime(str(item.date_from), "%Y-%m-%d")
|
||||
if leave_from_1 <= leave_to_1:
|
||||
item.days = (leave_to_1 - leave_from_1).days + 1
|
||||
# item.days = (leave_to_1 - leave_from_1).days + 1
|
||||
date_range = [leave_from_1.date() + timedelta(days=i)
|
||||
for i in range((leave_to_1 - leave_from_1).days + 1)]
|
||||
if item.official_mission_id.mission_type and item.official_mission_id.mission_type.working_days:
|
||||
calendar = item.official_mission_id.company_id.resource_calendar_id
|
||||
if not calendar:
|
||||
raise ValidationError(_('Company working calendar is not configured.'))
|
||||
|
||||
weekend_days = calendar.full_day_off or calendar.shift_day_off
|
||||
weekend_names = [d.name.lower() for d in weekend_days]
|
||||
date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names]
|
||||
|
||||
item.days = len(date_range)
|
||||
else:
|
||||
raise exceptions.Warning(_('Date Form Must Be Less than Date To'))
|
||||
else:
|
||||
|
|
@ -1309,7 +1358,19 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
leave_to_1 = datetime.strptime(str(item.official_mission_id.date_to), "%Y-%m-%d")
|
||||
leave_from_1 = datetime.strptime(str(item.official_mission_id.date_from), "%Y-%m-%d")
|
||||
if leave_from_1 <= leave_to_1:
|
||||
item.days = (leave_to_1 - leave_from_1).days + 1
|
||||
# item.days = (leave_to_1 - leave_from_1).days + 1
|
||||
date_range = [leave_from_1.date() + timedelta(days=i)
|
||||
for i in range((leave_to_1 - leave_from_1).days + 1)]
|
||||
if item.official_mission_id.mission_type and item.official_mission_id.mission_type.working_days:
|
||||
calendar = item.official_mission_id.company_id.resource_calendar_id
|
||||
if not calendar:
|
||||
raise ValidationError(_('Company working calendar is not configured.'))
|
||||
|
||||
weekend_days = calendar.full_day_off or calendar.shift_day_off
|
||||
weekend_names = [d.name.lower() for d in weekend_days]
|
||||
date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names]
|
||||
|
||||
item.days = len(date_range)
|
||||
else:
|
||||
raise exceptions.Warning(_('Date Form Must Be Less than Date To'))
|
||||
|
||||
|
|
@ -1322,7 +1383,7 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
if item.official_mission_id.hour_to and item.official_mission_id.hour_from:
|
||||
if item.hour_from and item.hour_to:
|
||||
if (item.hour_to - item.hour_from) < 0:
|
||||
item.hours = (24 -item.hour_from ) + item.hour_to
|
||||
item.hours = (24 - item.hour_from) + item.hour_to
|
||||
item.total_hours = item.hours * item.days
|
||||
# raise exceptions.Warning(_('Number of hours to must be greater than hours from'))
|
||||
else:
|
||||
|
|
@ -1332,7 +1393,7 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
item.hour_from = item.official_mission_id.hour_from
|
||||
item.hour_to = item.official_mission_id.hour_to
|
||||
if (item.hour_to - item.hour_from) < 0:
|
||||
item.hours = (24 -item.hour_from ) + item.hour_to
|
||||
item.hours = (24 - item.hour_from) + item.hour_to
|
||||
item.total_hours = item.hours * item.days
|
||||
# raise exceptions.Warning(_('Number of hours to must be greater than hours from'))
|
||||
else:
|
||||
|
|
@ -1487,7 +1548,7 @@ class HrOfficialMissionEmployee(models.Model):
|
|||
finacial = rec.official_mission_id.mission_type.related_with_financial
|
||||
delegation = rec.official_mission_id.mission_type.work_state
|
||||
if modules_req:
|
||||
#if delegation == 'legation' and finacial:
|
||||
# if delegation == 'legation' and finacial:
|
||||
if finacial == True:
|
||||
if rec.date_to and rec.date_from:
|
||||
clause_1 = ['&', ('employee_over_time_id.date_from', '<=', rec.date_from),
|
||||
|
|
@ -1625,7 +1686,7 @@ class HrContract(models.Model):
|
|||
'email_cc': '%s, %s' % (self.env.user.company_id.hr_email, rec.employee_id.work_email),
|
||||
'model': self._name,
|
||||
}
|
||||
#self.env['mail.mail'].create(main_content).send()
|
||||
# self.env['mail.mail'].create(main_content).send()
|
||||
|
||||
if emp in to_end.mapped('employee_id').ids:
|
||||
emp_to_end = to_end.filtered(lambda e: e.employee_id.id == emp)
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
<field name="max_amount" string="Maximum Amount"
|
||||
attrs="{'invisible':[('related_with_financial','=',False)],'required':[('related_with_financial','=',True)]}"/>
|
||||
<field name="approve_by"/>
|
||||
<field name="working_days"/>
|
||||
|
||||
<!--separator string="Accounting"
|
||||
attrs="{'invisible':[('related_with_financial','=',False)]}"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_partner_form_inherit_training" model="ir.ui.view">
|
||||
<field name="name">res.partner.form.inherit.training</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='category_id']" position="after">
|
||||
<field name="training" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
<field name="ticket_check"/>
|
||||
<field name="allowance_name"/>
|
||||
<field name="account_debit_id"/>
|
||||
<field name="analytic_account_id"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
|
||||
<menuitem name="Employee Training" id="employee_training_menu_item"
|
||||
parent="employee_requests.employee_request_menu_item"
|
||||
action="employee_training_action"/>
|
||||
parent="employee_requests.employee_request_menu_item"
|
||||
action="employee_training_action" />
|
||||
|
||||
<record model="ir.ui.view" id="employee_training_form_view">
|
||||
<field name="name">Employee Training</field>
|
||||
|
|
@ -20,245 +20,295 @@
|
|||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button name="send_depart_manager" string="Submit" class="oe_highlight" type="object"
|
||||
states="draft" groups="base.group_user"/>
|
||||
<button name="direct_manager" string="Direct Manager Approve" class="oe_highlight" type="object"
|
||||
states="send" groups="hr_base.group_division_manager"/>
|
||||
<button name="direct_manager_refused" string="Refused" class="oe_highlight" type="object"
|
||||
states="send" groups="hr_base.group_division_manager"/>
|
||||
<button name="send_depart_manager" string="Submit" class="oe_highlight"
|
||||
type="object"
|
||||
states="draft" groups="base.group_user" />
|
||||
<button name="direct_manager" string="Direct Manager Approve"
|
||||
class="oe_highlight" type="object"
|
||||
states="send" groups="hr_base.group_division_manager" />
|
||||
<button name="direct_manager_refused" string="Refused" class="oe_highlight"
|
||||
type="object"
|
||||
states="send" groups="hr_base.group_division_manager" />
|
||||
|
||||
<button name="depart_manager" string="Department Manager" class="oe_highlight" type="object"
|
||||
states="direct_manager" groups="hr_base.group_department_manager"/>
|
||||
<button name="dep_manager_refused" string="Refused" class="oe_highlight" type="object"
|
||||
states="direct_manager" groups="hr_base.group_department_manager"/>
|
||||
<button name="depart_manager" string="Department Manager"
|
||||
class="oe_highlight" type="object"
|
||||
states="direct_manager" groups="hr_base.group_department_manager" />
|
||||
<button name="dep_manager_refused" string="Refused" class="oe_highlight"
|
||||
type="object"
|
||||
states="direct_manager" groups="hr_base.group_department_manager" />
|
||||
|
||||
<button name="hr_aaproval" string="HR Approval" class="oe_highlight" type="object"
|
||||
states="depart_manager"
|
||||
groups="exp_official_mission.group_hr_training_user"/>
|
||||
<button name="hr_aaproval" string="HR Approval" class="oe_highlight"
|
||||
type="object"
|
||||
states="depart_manager"
|
||||
groups="exp_official_mission.group_hr_training_user" />
|
||||
<button name="refused" string="Refused" class="oe_highlight" type="object"
|
||||
states="depart_manager"
|
||||
groups="exp_official_mission.group_hr_training_user"/>
|
||||
states="depart_manager"
|
||||
groups="exp_official_mission.group_hr_training_user" />
|
||||
|
||||
<button name="approve" string="Approve" class="oe_highlight" type="object"
|
||||
states="hr_aaproval" groups="exp_official_mission.group_hr_training_manager"/>
|
||||
states="hr_aaproval"
|
||||
groups="exp_official_mission.group_hr_training_manager" />
|
||||
<button name="refused" string="Refused" class="oe_highlight" type="object"
|
||||
states="hr_aaproval"
|
||||
groups="exp_official_mission.group_hr_training_manager"/>
|
||||
states="hr_aaproval"
|
||||
groups="exp_official_mission.group_hr_training_manager" />
|
||||
|
||||
<button name="draft_state" string="RE-Draft" class="oe_highlight" type="object"
|
||||
states="approve,refused" groups="hr.group_hr_user"
|
||||
confirm="Are you sure to Reset To Draft This Record?"/>
|
||||
<button name="action_training_appraisal" string="Training Course Appraisal" type="object" class="oe_highlight"
|
||||
icon="fa-users" attrs="{'invisible':['|',('state','in',('draft','refused')),('appraisal_found','=',True)]}"/>
|
||||
<button name="draft_state" string="RE-Draft" class="oe_highlight"
|
||||
type="object"
|
||||
states="approve,refused" groups="hr.group_hr_user"
|
||||
confirm="Are you sure to Reset To Draft This Record?" />
|
||||
<button name="action_training_appraisal" string="Training Course Appraisal"
|
||||
type="object" class="oe_highlight"
|
||||
icon="fa-users"
|
||||
attrs="{'invisible':['|',('state','in',('draft','refused')),('appraisal_found','=',True)]}" />
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,send,direct_manager,depart_manager,hr_aaproval,approve,refused"/>
|
||||
statusbar_visible="draft,send,direct_manager,depart_manager,hr_aaproval,approve,refused" />
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_get_attachment_view" class="oe_stat_button" icon="fa-file-text-o"
|
||||
type="object">
|
||||
<field name="attachment_count" widget="statinfo" string="Attachments"
|
||||
options="{'reload_on_button': true}"/>
|
||||
<button name="action_get_attachment_view" class="oe_stat_button"
|
||||
icon="fa-file-text-o"
|
||||
type="object">
|
||||
<field name="attachment_count" widget="statinfo"
|
||||
string="Attachments"
|
||||
options="{'reload_on_button': true}" />
|
||||
</button>
|
||||
|
||||
<button name="action_employees_appraisal" class="oe_stat_button" icon="fa-file-text-o"
|
||||
type="object">
|
||||
<field name="appraisal_count" widget="statinfo" string="Employees Appraisal"
|
||||
options="{'reload_on_button': true}"/>
|
||||
<button name="action_employees_appraisal" class="oe_stat_button"
|
||||
icon="fa-file-text-o"
|
||||
type="object">
|
||||
<field name="appraisal_count" widget="statinfo"
|
||||
string="Employees Appraisal"
|
||||
options="{'reload_on_button': true}" />
|
||||
</button>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="hr_nomination" attrs="{'readonly': [('state', '!=', 'draft')]}" groups="hr.group_hr_user"/>
|
||||
<field name="process_type" invisible="1"/>
|
||||
<field name="hr_nomination"
|
||||
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
||||
groups="hr.group_hr_user" />
|
||||
<field name="process_type" invisible="1" />
|
||||
<field name="mission_type" string="Mission Type" required="1"
|
||||
domain="[('work_state', '=', 'training'),('special_hours', '!=', True)]"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
domain="[('work_state', '=', 'training'),('special_hours', '!=', True)]"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
<field name="course_name" string="Course Name" required="1"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
<field name="train_category" string="Category" required="1"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
<!--when Duration type in mission type is days-->
|
||||
<field name="duration_type" string="Duration Type" invisible="1"/>
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
<!--when
|
||||
Duration type in mission type is days-->
|
||||
<field name="duration_type" string="Duration Type" invisible="1" />
|
||||
<field name="date_from" string="Date From" required="1"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
<field name="date_to" string="Date To" required="1"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
<!--when Duration type in mission type is hours-->
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
<!--when
|
||||
Duration type in mission type is hours-->
|
||||
<field name="hour_from" string="Hour From" widget="float_time"
|
||||
attrs="{'required': [('state', '=', 'depart_manager')],
|
||||
'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
attrs="{'required': [('state', '=', 'depart_manager')],
|
||||
'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
<field name="hour_to" string="Hour To" widget="float_time"
|
||||
attrs="{'required': [('state', '=', 'depart_manager')],
|
||||
'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
<field name="hour_duration" string="Duration Hours" readonly="1" force_save="1"
|
||||
widget="float_time"
|
||||
attrs="{'required':[('duration_type','=','hours')]}"/>
|
||||
<field name="date_duration" string="Duration Days" readonly="1" force_save="1"
|
||||
attrs="{'required':[('duration_type','=','days')]}"/>
|
||||
attrs="{'required': [('state', '=', 'depart_manager')],
|
||||
'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
<field name="hour_duration" string="Duration Hours" readonly="1"
|
||||
force_save="1"
|
||||
widget="float_time"
|
||||
attrs="{'required':[('duration_type','=','hours')]}" />
|
||||
<field name="date_duration" string="Duration Days" readonly="1"
|
||||
force_save="1"
|
||||
attrs="{'required':[('duration_type','=','days')]}" />
|
||||
|
||||
<field name="total_hours" string="Total Hours" readonly="1" force_save="1"
|
||||
/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"
|
||||
readonly="1" />
|
||||
<field name="employee_id" string="Responsible" required="1"
|
||||
attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="employee_no" string="Employee Number" readonly="1"/>
|
||||
<field name="department_id2" string="Department" readonly="1"/>
|
||||
<field name="date" string="Date Request" attrs="{'readonly':[('state','!=','draft')]}"
|
||||
required="1"/>
|
||||
<field name="department_id" string="Department" widget="many2many_tags" attrs="{'readonly':[('state','=','approve')]}"/>
|
||||
attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="employee_no" string="Employee Number" readonly="1" />
|
||||
<field name="department_id2" string="Department" readonly="1" />
|
||||
<field name="date" string="Date Request"
|
||||
attrs="{'readonly':[('state','!=','draft')]}"
|
||||
required="1" />
|
||||
<field name="department_id" string="Department"
|
||||
widget="many2many_tags"
|
||||
attrs="{'readonly':[('state','=','approve')]}" />
|
||||
<field name="country_id" string="Country"
|
||||
attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="destination" string="Destination" required="1" widget="selection"
|
||||
domain="[('country_id','=',country_id),('destination_type','in',('training','all'))]"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }"/>
|
||||
attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="destination" string="Destination" widget="selection"
|
||||
domain="[('country_id','=',country_id),('destination_type','in',('training','all'))]"
|
||||
attrs="{'readonly':[('state','not in',('draft','direct_manager','depart_manager','send'))] }" />
|
||||
|
||||
<field name="partner_id" string="Organiser" required="1" attrs="{'readonly':[('state','=','approve')]}"/>
|
||||
<field name="trainer_id" attrs="{'readonly':[('state','=','approve')]}"/>
|
||||
<field name="partner_id" string="Organiser" required="1"
|
||||
attrs="{'readonly':[('state','=','approve')]}" />
|
||||
<field name="trainer_id"
|
||||
domain="[('is_company','=',False)]"
|
||||
attrs="{'readonly':[('state','=','approve')]}" />
|
||||
|
||||
<field name="move_type" string="Move type"
|
||||
attrs="{'readonly':[('state','!=','depart_manager')], 'required': [('state', '=', 'depart_manager')],'invisible':[('related_with_financial','=',False)]}"/>
|
||||
attrs="{'readonly':[('state','!=','depart_manager')], 'required': [('state', '=', 'depart_manager')],'invisible':[('related_with_financial','=',False)]}" />
|
||||
<field name="official_mission" string="Allowance Name"
|
||||
attrs="{'readonly':[('state','!=','depart_manager')],
|
||||
attrs="{'readonly':[('state','!=','depart_manager')],
|
||||
'invisible':['|',('related_with_financial','=',False),('move_type','!=','payroll')],
|
||||
'required':[('move_type','=','payroll'),('state', '=', 'depart_manager'),('related_with_financial','=',True)]}"/>
|
||||
<field name="Training_cost" string="Training Cost" attrs="{'readonly':[('state','=','approve')]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager"/>
|
||||
'required':[('move_type','=','payroll'),('state', '=', 'depart_manager'),('related_with_financial','=',True)]}" />
|
||||
<field name="Training_cost" string="Training Cost"
|
||||
attrs="{'readonly':[('state','=','approve')]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
|
||||
|
||||
<field name="Tra_cost_invo_id" string="Training Cost Invoice"
|
||||
attrs="{'invisible':['|',('state','!=','approve'),('Tra_cost_invo_id','=',False)]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager"/>
|
||||
attrs="{'invisible':['|',('state','!=','approve'),('Tra_cost_invo_id','=',False)]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
|
||||
|
||||
|
||||
<field name="min_of_employee" string="Min Trainees" attrs="{'readonly':[('state','=','approve')]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager"/>
|
||||
<field name="min_of_employee" string="Min Trainees"
|
||||
attrs="{'readonly':[('state','=','approve')]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
|
||||
|
||||
<field name="max_of_employee" string="Max Trainees" attrs="{'readonly':[('state','=','approve')]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager"/>
|
||||
<field name="appraisal_check" invisible="1"/>
|
||||
<field name="appraisal_found" invisible="1"/>
|
||||
<field name="max_of_employee" string="Max Trainees"
|
||||
attrs="{'readonly':[('state','=','approve')]}"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
|
||||
<field name="appraisal_check" invisible="1" />
|
||||
<field name="appraisal_found" invisible="1" />
|
||||
|
||||
</group>
|
||||
</group>
|
||||
<!--group string="Mission Purpose">
|
||||
<!--group
|
||||
string="Mission Purpose">
|
||||
<field name="mission_purpose" nolabel="1"
|
||||
attrs="{'readonly':[('state','!=','draft')]}" required="1"/>
|
||||
</group-->
|
||||
<notebook>
|
||||
<page string="Employees" name="employees">
|
||||
<field name="related_with_financial" invisible="1"/>
|
||||
<div style="display: inline-block;margin-right: 2px;">
|
||||
<button name="action_add_employees" string=" Add Employees " type="object" class="oe_highlight"
|
||||
icon="fa-users"/>
|
||||
<button name="re_compute" string=" Re-Compute " type="object" class="oe_highlight"
|
||||
icon="fa-cogs" style="margin-right: 20px;"
|
||||
attrs="{'invisible':[('state','in',('approve','refused','send'))]}"/>
|
||||
</div>
|
||||
<field name="related_with_financial" invisible="1" />
|
||||
<div style="display: inline-block;margin-right: 2px;">
|
||||
<button name="action_add_employees" string=" Add Employees "
|
||||
type="object" class="oe_highlight"
|
||||
icon="fa-users" />
|
||||
<button name="re_compute" string=" Re-Compute " type="object"
|
||||
class="oe_highlight"
|
||||
icon="fa-cogs" style="margin-right: 20px;"
|
||||
attrs="{'invisible':[('state','in',('approve','refused','send'))]}" />
|
||||
</div>
|
||||
<field name="employee_ids"
|
||||
attrs="{'readonly':[('state','not in',('depart_manager','direct_manager','send','draft'))]}">
|
||||
attrs="{'readonly':[('state','not in',('depart_manager','direct_manager','send','draft'))]}">
|
||||
<tree editable="bottom">
|
||||
<field name="employee_id" string="Employee" required="1"/>
|
||||
<field name="date_from" string="Date from"/>
|
||||
<field name="date_to" string="Date to"/>
|
||||
<field name="days" string="Days" readonly="0"/>
|
||||
<field name="employee_id" string="Employee" required="1" />
|
||||
<field name="date_from" string="Date from" />
|
||||
<field name="date_to" string="Date to" />
|
||||
<field name="days" string="Days" readonly="0" />
|
||||
|
||||
<field name="day_price" string="Day price"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','days'),
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','days'),
|
||||
('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1"/>
|
||||
<field name="hour_from" string="Hour from" widget="float_time"
|
||||
readonly="1" force_save="1" />
|
||||
<field name="hour_from" string="Hour from"
|
||||
widget="float_time"
|
||||
/>
|
||||
<field name="hour_to" string="Hour to" widget="float_time"
|
||||
/>
|
||||
<field name="hours" string="Hours" readonly="0" widget="float_time"/>
|
||||
<field name="hours" string="Hours" readonly="0"
|
||||
widget="float_time" />
|
||||
<field name="total_hours" string="Total Hours" readonly="0"
|
||||
widget="float_time"/>
|
||||
widget="float_time" />
|
||||
|
||||
<field name="hour_price" string="Hour price"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','hours'),
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','hours'),
|
||||
('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1"/>
|
||||
readonly="1" force_save="1" />
|
||||
|
||||
<field name="fees_amount" string="Fees Amount"
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="0"/>
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="0" />
|
||||
|
||||
<field name="train_cost_emp" string="Training Cost"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager"/>
|
||||
<field name="appraisal_id" string="Appraisal" readonly="1" force_save="1" invisible="1"/>
|
||||
<field name="appraisal_result" string="Appraisal Result" readonly="1"
|
||||
force_save="1"
|
||||
attrs="{'column_invisible':[('parent.appraisal_check','=',False)]}"/>
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
|
||||
<field name="appraisal_id" string="Appraisal" readonly="1"
|
||||
force_save="1" invisible="1" />
|
||||
<field name="appraisal_result" string="Appraisal Result"
|
||||
readonly="1"
|
||||
force_save="1"
|
||||
attrs="{'column_invisible':[('parent.appraisal_check','=',False)]}" />
|
||||
|
||||
<field name="amount" string="Amount"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1"/>
|
||||
<field name="account_move_id" string="Account move" readonly="1" force_save="1"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
|
||||
('parent.move_type','!=','accounting')]}"/>
|
||||
<field name="status" string="Employee Status"/>
|
||||
<field name="attachment_count" invisible="1"/>
|
||||
<button name="action_get_attachment_view" string="Attachments" type="object"
|
||||
icon="fa-paperclip" attrs="{'invisible': [('attachment_count', '=', 0)]}"/>
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1" />
|
||||
<field name="account_move_id" string="Account move"
|
||||
readonly="1" force_save="1"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
|
||||
('parent.move_type','!=','accounting')]}" />
|
||||
<field name="status" string="Employee Status" />
|
||||
<field name="attachment_count" invisible="1" />
|
||||
<button name="action_get_attachment_view"
|
||||
string="Attachments" type="object"
|
||||
icon="fa-paperclip"
|
||||
attrs="{'invisible': [('attachment_count', '=', 0)]}" />
|
||||
|
||||
</tree>
|
||||
|
||||
<form string="Employee Training Course Day">
|
||||
<sheet>
|
||||
<group col="4">
|
||||
<field name="employee_id" string="Employee" required="1"/>
|
||||
<field name="date_from" string="Date from"/>
|
||||
<field name="date_to" string="Date to"/>
|
||||
<field name="days" string="Days" readonly="0"/>
|
||||
<field name="employee_id" string="Employee"
|
||||
required="1" />
|
||||
<field name="date_from" string="Date from" />
|
||||
<field name="date_to" string="Date to" />
|
||||
<field name="days" string="Days" readonly="0" />
|
||||
|
||||
<field name="day_price" string="Day price"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','days'),
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','days'),
|
||||
('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1"/>
|
||||
<field name="hour_from" string="Hour from" widget="float_time"
|
||||
readonly="1" force_save="1" />
|
||||
<field name="hour_from" string="Hour from"
|
||||
widget="float_time"
|
||||
/>
|
||||
<field name="hour_to" string="Hour to" widget="float_time"
|
||||
<field name="hour_to" string="Hour to"
|
||||
widget="float_time"
|
||||
/>
|
||||
<field name="hours" string="Hours" readonly="0" widget="float_time"/>
|
||||
<field name="total_hours" string="Total Hours" readonly="1"
|
||||
widget="float_time"/>
|
||||
|
||||
<field name="hours" string="Hours" readonly="0"
|
||||
widget="float_time" />
|
||||
<field name="total_hours" string="Total Hours"
|
||||
readonly="0"
|
||||
widget="float_time" />
|
||||
|
||||
|
||||
<field name="hour_price" string="Hour price"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','hours'),
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.duration_type','!=','hours'),
|
||||
('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1"/>
|
||||
readonly="1" force_save="1" />
|
||||
|
||||
<field name="fees_amount" string="Fees Amount"
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="0"/>
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="0" />
|
||||
|
||||
<field name="train_cost_emp" string="Training Cost"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager"/>
|
||||
<field name="appraisal_id" string="Appraisal" readonly="1"
|
||||
force_save="1"
|
||||
invisible="1"/>
|
||||
<field name="appraisal_result" string="Appraisal Result" readonly="1"
|
||||
force_save="1"
|
||||
attrs="{'column_invisible':[('parent.appraisal_check','=',False)]}"/>
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user,hr_base.group_division_manager" />
|
||||
<field name="appraisal_id" string="Appraisal"
|
||||
readonly="1"
|
||||
force_save="1"
|
||||
invisible="1" />
|
||||
<field name="appraisal_result"
|
||||
string="Appraisal Result" readonly="1"
|
||||
force_save="1"
|
||||
attrs="{'column_invisible':[('parent.appraisal_check','=',False)]}" />
|
||||
|
||||
<field name="amount" string="Amount"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1"/>
|
||||
<field name="account_move_id" string="Account move" readonly="1"
|
||||
force_save="1"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
|
||||
('parent.move_type','!=','accounting')]}"/>
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':[('parent.related_with_financial','=',False)]}"
|
||||
readonly="1" force_save="1" />
|
||||
<field name="account_move_id" string="Account move"
|
||||
readonly="1"
|
||||
force_save="1"
|
||||
groups="hr_base.group_account_manager,hr.group_hr_user"
|
||||
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
|
||||
('parent.move_type','!=','accounting')]}" />
|
||||
|
||||
</group>
|
||||
</sheet>
|
||||
|
|
@ -270,23 +320,27 @@
|
|||
<group>
|
||||
<group>
|
||||
<field name="issuing_ticket" string="Issuing Ticket?"
|
||||
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}"/>
|
||||
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}" />
|
||||
|
||||
<field name="ticket_cash_request_type" string="Ticket/Cash Request Type"
|
||||
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}"/>
|
||||
<field name="ticket_cash_request_type"
|
||||
string="Ticket/Cash Request Type"
|
||||
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}" />
|
||||
|
||||
<field name="ticket_cash_request_for" string="Ticket/Cash Request For"
|
||||
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}"/>
|
||||
<field name="ticket_cash_request_for"
|
||||
string="Ticket/Cash Request For"
|
||||
attrs="{'readonly':[('state','not in',('draft','depart_manager','send'))],'required':[('issuing_ticket','=','yes')]}" />
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<!-- <field name="ticket_insurance" string="Ticket Insurance"-->
|
||||
<!-- <field name="ticket_insurance" string="Ticket
|
||||
Insurance"-->
|
||||
<!-- attrs="{'readonly':[('state','!=','draft')]}"/>-->
|
||||
<field name="self_car" string="Self Car"
|
||||
attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="visa" string="Visa" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="visa" string="Visa"
|
||||
attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="note" string="Other"
|
||||
attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
</group>
|
||||
<!-- <group>-->
|
||||
<!-- <field name="car_insurance" string="Car Insurance"-->
|
||||
|
|
@ -302,7 +356,9 @@
|
|||
</page>
|
||||
<page string="Training Details">
|
||||
<group>
|
||||
<field name="training_details" string='Training Details' required="1" attrs="{'readonly':[('state','=','approve')]}" nolabel="1"/>
|
||||
<field name="training_details" string='Training Details'
|
||||
required="1" attrs="{'readonly':[('state','=','approve')]}"
|
||||
nolabel="1" />
|
||||
</group>
|
||||
|
||||
</page>
|
||||
|
|
@ -326,14 +382,15 @@
|
|||
|
||||
<page string="Attachments" name="attachments" invisible="1">
|
||||
<field name="attach_ids" string="Attachments"
|
||||
attrs="{'readonly':[('state','!=','draft')]}">
|
||||
attrs="{'readonly':[('state','!=','draft')]}">
|
||||
<tree editable="bottom">
|
||||
<field name="name" string="attachment Name"/>
|
||||
<field name="datas" string="file content"/>
|
||||
<field name="name" string="attachment Name" />
|
||||
<field name="datas" string="file content" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<!--page string="Information" name="information">
|
||||
<!--page
|
||||
string="Information" name="information">
|
||||
<group>
|
||||
<group>
|
||||
<field name="approved_by" string="Approved By"
|
||||
|
|
@ -347,11 +404,11 @@
|
|||
</page-->
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="o_attachment_preview"/>
|
||||
<div class="o_attachment_preview" />
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_follower_ids" widget="mail_followers" />
|
||||
<field name="activity_ids" widget="mail_activity" />
|
||||
<field name="message_ids" widget="mail_thread" />
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
|
@ -362,21 +419,22 @@
|
|||
<field name="model">hr.official.mission</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-danger="state == 'refused'" decoration-info="state == 'draft'"
|
||||
string="Employee Training">
|
||||
<field name="mission_type" string="Mission Type"/>
|
||||
<field name="employee_id" string="Responsible"/>
|
||||
<field name="date" string="Date Request"/>
|
||||
<field name="course_name" string="Course Name"/>
|
||||
<field name="train_category" string="Category"/>
|
||||
<field name="date_from" string="Date From"/>
|
||||
<field name="date_to" string="Date To"/>
|
||||
<field name="total_hours" string="Total Hours" />
|
||||
|
||||
<field name="destination" string="Destination"/>
|
||||
<field name="attachment_count" invisible="1"/>
|
||||
<button name="action_get_attachment_view" string="Attachments" type="object" icon="fa-paperclip"
|
||||
attrs="{'invisible': [('attachment_count', '=', 0)]}"/>
|
||||
<field name="state" string="Status"/>
|
||||
string="Employee Training">
|
||||
<field name="mission_type" string="Mission Type" />
|
||||
<field name="employee_id" string="Responsible" />
|
||||
<field name="date" string="Date Request" />
|
||||
<field name="course_name" string="Course Name" />
|
||||
<field name="train_category" string="Category" />
|
||||
<field name="date_from" string="Date From" />
|
||||
<field name="date_to" string="Date To" />
|
||||
<field name="destination" string="Destination" />
|
||||
<field name="attachment_count" invisible="1" />
|
||||
<button name="action_get_attachment_view" string="Attachments" type="object"
|
||||
icon="fa-paperclip"
|
||||
attrs="{'invisible': [('attachment_count', '=', 0)]}" />
|
||||
<field name="state" string="Status" />
|
||||
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
|
|
@ -389,26 +447,29 @@
|
|||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="course_name"/>
|
||||
<field name="mission_type"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="employee_no"/>
|
||||
<field name="destination"/>
|
||||
<field name="train_category"/>
|
||||
<field name="state"/>
|
||||
<field name="course_name" />
|
||||
<field name="mission_type" />
|
||||
<field name="employee_id" />
|
||||
<field name="employee_no" />
|
||||
<field name="destination" />
|
||||
<field name="train_category" />
|
||||
<field name="state" />
|
||||
<group expand="0" string="Group By">
|
||||
<filter name="group_employee" string="Responsible" domain="[]"
|
||||
context="{'group_by': 'employee_id'}"/>
|
||||
context="{'group_by': 'employee_id'}" />
|
||||
<filter name="group_type" string="Mission Type" domain="[]"
|
||||
context="{'group_by': 'mission_type'}"/>
|
||||
context="{'group_by': 'mission_type'}" />
|
||||
<filter name="group_department" string="Department" domain="[]"
|
||||
context="{'group_by': 'department_id2'}"/>
|
||||
<filter name="group_branch" string="Branch" domain="[]" context="{'group_by': 'is_branch'}"/>
|
||||
<filter name="group_state" string="State" domain="[]" context="{'group_by': 'state'}"/>
|
||||
context="{'group_by': 'department_id2'}" />
|
||||
<filter name="group_branch" string="Branch" domain="[]"
|
||||
context="{'group_by': 'is_branch'}" />
|
||||
<filter name="group_state" string="State" domain="[]"
|
||||
context="{'group_by': 'state'}" />
|
||||
</group>
|
||||
<separator/>
|
||||
<filter string="My Requests" name="my_request" domain="[('employee_id.user_id', '=', uid)]"/>
|
||||
<separator/>
|
||||
<separator />
|
||||
<filter string="My Requests" name="my_request"
|
||||
domain="[('employee_id.user_id', '=', uid)]" />
|
||||
<separator />
|
||||
</search>
|
||||
|
||||
</field>
|
||||
|
|
@ -416,29 +477,29 @@
|
|||
|
||||
|
||||
<record id="action_tagwaarden_tree" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
<field eval="1" name="sequence" />
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="employee_training_tree_view"/>
|
||||
<field name="act_window_id" ref="employee_training_action"/>
|
||||
<field name="view_id" ref="employee_training_tree_view" />
|
||||
<field name="act_window_id" ref="employee_training_action" />
|
||||
</record>
|
||||
|
||||
<record id="action_tagwaarden_form" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<field eval="2" name="sequence" />
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="employee_training_form_view"/>
|
||||
<field name="act_window_id" ref="employee_training_action"/>
|
||||
<field name="view_id" ref="employee_training_form_view" />
|
||||
<field name="act_window_id" ref="employee_training_action" />
|
||||
</record>
|
||||
|
||||
<!-- hr_job_inherit -->
|
||||
<record id="view_hr_job_cours_form_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.job.form.cours.inherit</field>
|
||||
<field name="model">hr.job</field>
|
||||
<field name="priority" eval="16"/>
|
||||
<field name="inherit_id" ref="hr.view_hr_job_form"/>
|
||||
<field name="priority" eval="16" />
|
||||
<field name="inherit_id" ref="hr.view_hr_job_form" />
|
||||
<field name="arch" type="xml">
|
||||
<notebook>
|
||||
<page string="Courses">
|
||||
<field name="course_ids" widget="many2many"/>
|
||||
<field name="course_ids" widget="many2many" />
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
|
|
@ -451,55 +512,64 @@
|
|||
<form>
|
||||
<header>
|
||||
<button name="approve" string="Approve" class="oe_highlight" type="object"
|
||||
attrs="{'invisible':[('status','!=','direct_manager')]}" groups="hr_base.group_division_manager"/>
|
||||
attrs="{'invisible':[('status','!=','direct_manager')]}"
|
||||
groups="hr_base.group_division_manager" />
|
||||
<button name="refuse" string="Refuse" class="oe_highlight" type="object"
|
||||
attrs="{'invisible':[('status','!=','direct_manager')]}" groups="hr_base.group_division_manager"/>
|
||||
attrs="{'invisible':[('status','!=','direct_manager')]}"
|
||||
groups="hr_base.group_division_manager" />
|
||||
<button name="done" string="Done" class="oe_highlight" type="object"
|
||||
attrs="{'invisible':[('status','!=','approved')]}"/>
|
||||
<button name="set_to_draft" string="Set to Draft" class="oe_highlight" type="object"
|
||||
attrs="{'invisible':[('status','not in', ('done','refused'))]}"/>
|
||||
<field name="status" widget="statusbar" statusbar_visible="draft,direct_manager,approved,approved2,done,refused"/>
|
||||
attrs="{'invisible':[('status','!=','approved')]}" />
|
||||
<button name="set_to_draft" string="Set to Draft" class="oe_highlight"
|
||||
type="object"
|
||||
attrs="{'invisible':[('status','not in', ('done','refused'))]}" />
|
||||
<field name="status" widget="statusbar"
|
||||
statusbar_visible="draft,direct_manager,approved,approved2,done,refused" />
|
||||
</header>
|
||||
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_get_attachment_view" class="oe_stat_button" icon="fa-file-text-o"
|
||||
type="object">
|
||||
<field name="attachment_count" widget="statinfo" string="Attachments"
|
||||
options="{'reload_on_button': true}"/>
|
||||
<button name="action_get_attachment_view" class="oe_stat_button"
|
||||
icon="fa-file-text-o"
|
||||
type="object">
|
||||
<field name="attachment_count" widget="statinfo"
|
||||
string="Attachments"
|
||||
options="{'reload_on_button': true}" />
|
||||
</button>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="employee_id" readonly="1"/>
|
||||
<field name="official_mission_id" readonly="1" string='Mission Type'/>
|
||||
<field name="days" readonly="1"/>
|
||||
<field name="hours" readonly="1" widget="float_time"/>
|
||||
<field name="employee_id" readonly="1" />
|
||||
<field name="official_mission_id" readonly="1" string='Mission Type' />
|
||||
<field name="days" readonly="1" />
|
||||
<field name="hours" readonly="1" widget="float_time" />
|
||||
</group>
|
||||
<group>
|
||||
|
||||
<field name="date_from" readonly="1"/>
|
||||
<field name="date_to" readonly="1"/>
|
||||
<field name="appraisal_id" attrs="{'invisible':[('appraisal_id','=',False)]}"/>
|
||||
<field name="appraisal_result" attrs="{'invisible':[('appraisal_id','=',False)]}"/>
|
||||
<field name="date_from" readonly="1" />
|
||||
<field name="date_to" readonly="1" />
|
||||
<field name="appraisal_id"
|
||||
attrs="{'invisible':[('appraisal_id','=',False)]}" />
|
||||
<field name="appraisal_result"
|
||||
attrs="{'invisible':[('appraisal_id','=',False)]}" />
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="hour_from" readonly="1" widget="float_time"/>
|
||||
<field name="hour_to" readonly="1" widget="float_time"/>
|
||||
<field name="total_hours" string="Total Hours" readonly="0" widget="float_time"/>
|
||||
<field name="training_details"/>
|
||||
<field name="hour_from" readonly="1" widget="float_time" />
|
||||
<field name="hour_to" readonly="1" widget="float_time" />
|
||||
<field name="total_hours" string="Total Hours" readonly="0"
|
||||
widget="float_time" />
|
||||
<field name="training_details" />
|
||||
|
||||
</group>
|
||||
|
||||
</group>
|
||||
|
||||
</sheet>
|
||||
<div class="o_attachment_preview"/>
|
||||
<div class="o_attachment_preview" />
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_follower_ids" widget="mail_followers" />
|
||||
<field name="activity_ids" widget="mail_activity" />
|
||||
<field name="message_ids" widget="mail_thread" />
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
|
@ -510,23 +580,26 @@
|
|||
<field name="name">Employee Training Course</field>
|
||||
<field name="model">hr.official.mission.employee</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Employee official mission Line" decoration-info="status == 'draft'" decoration-danger="status == 'refused'" decoration-success="status=='approved'">
|
||||
<field name="employee_id"/>
|
||||
<field name="official_mission_id" string='Mission Type'/>
|
||||
<field name="course_name"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="days"/>
|
||||
<field name="hour_from" widget="float_time"/>
|
||||
<field name="hour_to" widget="float_time"/>
|
||||
<field name="hours" widget="float_time"/>
|
||||
<field name="appraisal_id" invisible="1"/>
|
||||
<field name="appraisal_result" attrs="{'invisible':[('appraisal_id','=',False)]}"/>
|
||||
<field name="status" string="Employee Status"/>
|
||||
<field name="state" string="Status" invisible="1"/>
|
||||
<field name="attachment_count" invisible="1"/>
|
||||
<button name="action_get_attachment_view" string="Attachments" type="object" icon="fa-paperclip"
|
||||
attrs="{'invisible': [('attachment_count', '=', 0)]}"/>
|
||||
<tree string="Employee official mission Line" decoration-info="status == 'draft'"
|
||||
decoration-danger="status == 'refused'" decoration-success="status=='approved'">
|
||||
<field name="employee_id" />
|
||||
<field name="official_mission_id" string='Mission Type' />
|
||||
<field name="course_name" />
|
||||
<field name="date_from" />
|
||||
<field name="date_to" />
|
||||
<field name="days" />
|
||||
<field name="hour_from" widget="float_time" />
|
||||
<field name="hour_to" widget="float_time" />
|
||||
<field name="hours" widget="float_time" />
|
||||
<field name="appraisal_id" invisible="1" />
|
||||
<field name="appraisal_result"
|
||||
attrs="{'invisible':[('appraisal_id','=',False)]}" />
|
||||
<field name="status" string="Employee Status" />
|
||||
<field name="state" string="Status" invisible="1" />
|
||||
<field name="attachment_count" invisible="1" />
|
||||
<button name="action_get_attachment_view" string="Attachments" type="object"
|
||||
icon="fa-paperclip"
|
||||
attrs="{'invisible': [('attachment_count', '=', 0)]}" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -543,23 +616,21 @@
|
|||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_employees_training_lines_form" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<record id="action_employees_training_lines_form" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence" />
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="hr_employees_training_lines_form"/>
|
||||
<field name="act_window_id" ref="hr_employees_training_lines_action"/>
|
||||
<field name="view_id" ref="hr_employees_training_lines_form" />
|
||||
<field name="act_window_id" ref="hr_employees_training_lines_action" />
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record id="action_employees_training_lines_tree" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
<field eval="1" name="sequence" />
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="hr_employees_training_lines_tree"/>
|
||||
<field name="act_window_id" ref="hr_employees_training_lines_action"/>
|
||||
<field name="view_id" ref="hr_employees_training_lines_tree" />
|
||||
<field name="act_window_id" ref="hr_employees_training_lines_action" />
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
</odoo>
|
||||
|
|
@ -788,4 +788,9 @@ msgstr "هل أنت متأكد من إرجاع السجل لحالة المسو
|
|||
msgid ""
|
||||
"The Amount of the Ticket is calculated according the type of request or the "
|
||||
"class of the ticket destination"
|
||||
msgstr "تحسب قيمة التذكرة حسب اسم الاستحقاق في نوع الطلب او حسب درجة التذكرة من الوجهة"
|
||||
msgstr "تحسب قيمة التذكرة حسب اسم الاستحقاق في نوع الطلب او حسب درجة التذكرة من الوجهة"
|
||||
|
||||
#. module: exp_ticket_request
|
||||
#: model:ir.model.fields,field_description:exp_ticket_request.field_hr_ticket_request_type__analytic_account_id
|
||||
msgid "Analytic Account"
|
||||
msgstr "الحساب التحليلي"
|
||||
|
|
|
|||
|
|
@ -105,7 +105,8 @@ class HrTicketing(models.Model):
|
|||
'debit': self.cost_of_tickets,
|
||||
'date': self.request_date,
|
||||
'account_id': self.request_type.account_debit_id.id,
|
||||
'partner_id': self.employee_id.user_id.partner_id.id
|
||||
'partner_id': self.employee_id.user_id.partner_id.id,
|
||||
'analytic_account_id': self.request_type.analytic_account_id.id,
|
||||
}
|
||||
credit_line_vals = {
|
||||
'name': 'credit',
|
||||
|
|
@ -119,7 +120,7 @@ class HrTicketing(models.Model):
|
|||
'state': 'draft',
|
||||
'journal_id': self.journal_id.id,
|
||||
'date': self.request_date,
|
||||
'ref': 'Ticket Request for "%s" ' % self.employee_id.name,
|
||||
'ref': 'Ticket Request for %s' % self.employee_id.name,
|
||||
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
|
||||
'res_model': 'hr.ticket.request',
|
||||
'res_id': self.id
|
||||
|
|
@ -338,4 +339,5 @@ class HrTicketingType(models.Model):
|
|||
# relational fields
|
||||
allowance_name = fields.Many2one('hr.salary.rule', domain=[('category_id.rule_type', '=', 'allowance')])
|
||||
account_debit_id = fields.Many2one('account.account')
|
||||
analytic_account_id = fields.Many2one(comodel_name='account.analytic.account',string='Analytic Account')
|
||||
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.user.company_id)
|
||||
|
|
|
|||
|
|
@ -1561,8 +1561,8 @@ msgstr "نوع الموظف"
|
|||
#: code:addons/hr_contract_custom/models/hr_contract.py:0
|
||||
#: model:ir.model.fields,field_description:hr_contract_custom.field_hr_contract__emp_type
|
||||
#, python-format
|
||||
msgid "Holiday Type"
|
||||
msgstr "ترصيد الاجازة"
|
||||
msgid "Annual Leave Entitlement"
|
||||
msgstr "الاستحقاق السنوي للاجازة"
|
||||
|
||||
#. module: hr_contract_custom
|
||||
#: model:ir.actions.server,name:hr_contract_custom.contracts_mail_reminder_ir_actions_server
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ class Contract(models.Model):
|
|||
('other', _('Holiday2')),
|
||||
('displaced', _('Holiday3')),
|
||||
('external', _('Holiday4')),
|
||||
('external2', _('Other'))], _('Holiday Type'), tracking=True)
|
||||
('external2', _('Other'))], _('Annual Leave Entitlement'), tracking=True)
|
||||
appraisal = fields.Boolean(_('Appraisal'))
|
||||
re_contract = fields.Boolean(_('re contract'))
|
||||
contract_draft = fields.Boolean(_('Contract Draft'))
|
||||
|
|
|
|||
|
|
@ -860,8 +860,8 @@ msgstr "طوارئ"
|
|||
|
||||
#. module: hr_holidays_public
|
||||
#: model:ir.model.fields,field_description:hr_holidays_public.field_hr_holidays_status__emp_type
|
||||
msgid "Emp Type"
|
||||
msgstr "نوع الموظف"
|
||||
msgid "Annual Leave Entitlement"
|
||||
msgstr "الاستحقاق السنوي للاجازة"
|
||||
|
||||
#. module: hr_holidays_public
|
||||
#: model:ir.model,name:hr_holidays_public.model_hr_employee
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class HrHolidaysStatus(models.Model):
|
|||
('other', _('Holiday2')),
|
||||
('displaced', _('Holiday3')),
|
||||
('external', _('Holiday4')),
|
||||
('external2', _('Other')), ('all', _('All'))], tracking=True)
|
||||
('external2', _('Other')), ('all', _('All'))],string='Annual Leave Entitlement', tracking=True)
|
||||
gender = fields.Selection(selection=[('male', _('Male')),
|
||||
('female', _('Female')),
|
||||
('both', _('Both'))], tracking=True)
|
||||
|
|
|
|||
|
|
@ -3,75 +3,88 @@
|
|||
<record id="edit_holiday_status_form" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.status.form - Add compute fields</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
<field name="inherit_id" ref="hr_holidays_community.edit_holiday_status_form"/>
|
||||
<field name="inherit_id" ref="hr_holidays_community.edit_holiday_status_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form/sheet" position="replace">
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" string="Description"/>
|
||||
<field name="leave_annual_type" required="1"/>
|
||||
<field name="number_of_holidays_save_years" string="Number of saved years"
|
||||
attrs="{'invisible':[('leave_annual_type','!=','save_annual_year')]}"/>
|
||||
<field name="gender" required="1"/>
|
||||
<field name="request_before"/>
|
||||
<field name="advance_request_years"/>
|
||||
<!--field name="category_id" string="Meeting Type"/-->
|
||||
<field name="working_days"/>
|
||||
<field name="official_holidays"/>
|
||||
<field name="include_weekend"/>
|
||||
<field name="exit_return_permission"/>
|
||||
<field name="name" string="Description" />
|
||||
<field name="leave_annual_type" required="1" />
|
||||
<field name="number_of_holidays_save_years"
|
||||
string="Number of saved years"
|
||||
attrs="{'invisible':[('leave_annual_type','!=','save_annual_year')]}" />
|
||||
<field name="gender" required="1" />
|
||||
<field name="request_before" />
|
||||
<field name="advance_request_years" />
|
||||
<!--field
|
||||
name="category_id" string="Meeting Type"/-->
|
||||
<field name="working_days" />
|
||||
<field name="official_holidays" />
|
||||
<field name="include_weekend" />
|
||||
<field name="exit_return_permission" />
|
||||
<field name="exit_return_permission_duration"
|
||||
attrs="{'invisible':[('exit_return_permission','=',False)],'required':[('exit_return_permission','=',True)]}"/>
|
||||
<field name="issuing_ticket"/>
|
||||
<!-- <field name="period_ticket" string="Period Ticket"-->
|
||||
<!-- attrs="{'invisible':[('issuing_ticket','=',False)]}"/>-->
|
||||
<!--field name="unpaid"/-->
|
||||
<field name="mission_chick" string="Interference Mission/Training?"/>
|
||||
<field name="attach_chick" string="Attachment Required?"/>
|
||||
<field name="alternative_chick" string="Alternative Required?"/>
|
||||
<field name="alternative_days" string="Alternative Days" attrs="{'invisible':[('alternative_chick','=',False)]}"/>
|
||||
attrs="{'invisible':[('exit_return_permission','=',False)],'required':[('exit_return_permission','=',True)]}" />
|
||||
<field name="issuing_ticket" />
|
||||
<!-- <field name="period_ticket" string="Period Ticket"-->
|
||||
<!-- attrs="{'invisible':[('issuing_ticket','=',False)]}"/>-->
|
||||
<!--field
|
||||
name="unpaid"/-->
|
||||
<field name="mission_chick" string="Interference Mission/Training?" />
|
||||
<field name="attach_chick" string="Attachment Required?" />
|
||||
<field name="alternative_chick" string="Alternative Required?" />
|
||||
<field name="alternative_days" string="Alternative Days"
|
||||
attrs="{'invisible':[('alternative_chick','=',False)]}" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="leave_type" string="Type Of Leave" required="1"/>
|
||||
<field name="balance_type" attrs="{'invisible':[('leave_type','!=','annual')],'required':[('leave_type','=','annual')]}"/> <field name="duration"
|
||||
attrs="{'invisible':[('leave_type','=','annual')],
|
||||
'required':[('leave_type','!=','annual')]}"/>
|
||||
<field name="sickness_severity" attrs="{'invisible':[('leave_type','!=','sick')],
|
||||
'required': [('leave_type','=','sick')]}"/>
|
||||
<field name="emp_type" string="Employee Type" required="1"/>
|
||||
<field name="contract_duration" required="1"/>
|
||||
<field name="minimum_duration"/>
|
||||
<label for="number_of_days" string="Employee working days"/>
|
||||
<field name="leave_type" string="Type Of Leave" required="1" />
|
||||
<field name="balance_type"
|
||||
attrs="{'invisible':[('leave_type','!=','annual')],'required':[('leave_type','=','annual')]}" />
|
||||
<field name="duration"
|
||||
attrs="{'invisible':[('leave_type','=','annual')],
|
||||
'required':[('leave_type','!=','annual')]}" />
|
||||
<field name="sickness_severity"
|
||||
attrs="{'invisible':[('leave_type','!=','sick')],
|
||||
'required': [('leave_type','=','sick')]}" />
|
||||
<field name="emp_type" string="Employee Type"
|
||||
attrs="{
|
||||
'invisible': [('leave_type', '!=', 'annual')],
|
||||
'required': [('leave_type', '=', 'annual')]
|
||||
}" />
|
||||
<field name="contract_duration" required="1" />
|
||||
<field name="minimum_duration" />
|
||||
<label for="number_of_days" string="Employee working days" />
|
||||
<div id="number_of_days">
|
||||
<field name="number_of_days" string="Employee working days"/>
|
||||
days
|
||||
</div>
|
||||
<field name="number_of_days" string="Employee working days" />
|
||||
days </div>
|
||||
<field name="not_balance_annual_leave"
|
||||
attrs="{'invisible':[('leave_type','=','annual')]}"/>
|
||||
<field name="visible_fields" string="Save Years?"/>
|
||||
attrs="{'invisible':[('leave_type','=','annual')]}" />
|
||||
<field name="visible_fields" string="Save Years?" />
|
||||
<field name="remained_before" required="1"
|
||||
attrs="{'invisible':[('visible_fields','!=',True)]}"/>
|
||||
attrs="{'invisible':[('visible_fields','!=',True)]}" />
|
||||
|
||||
<label for="number_of_years" attrs="{'invisible':[('visible_fields','=',False)]}"
|
||||
string="employee Save working Years"/>
|
||||
<div id="number_of_years" attrs="{'invisible':[('visible_fields','=',False)]}">
|
||||
<field name="number_of_years" string="employee Save working Years"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}"/>Years
|
||||
</div>
|
||||
<label for="number_of_years"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}"
|
||||
string="employee Save working Years" />
|
||||
<div id="number_of_years"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}">
|
||||
<field name="number_of_years"
|
||||
string="employee Save working Years"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}" />Years </div>
|
||||
<label for="number_of_save_days" string="Employee Save working days"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}"/>
|
||||
<div id="number_of_save_days" attrs="{'invisible':[('visible_fields','=',False)]}">
|
||||
<field name="number_of_save_days" string="Employee Save working days"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}"/>
|
||||
days
|
||||
</div>
|
||||
<field name="used_once"/>
|
||||
<field name="issuing_clearance_form"/>
|
||||
<field name="issuing_deliver_custody"/>
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}" />
|
||||
<div id="number_of_save_days"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}">
|
||||
<field name="number_of_save_days"
|
||||
string="Employee Save working days"
|
||||
attrs="{'invisible':[('visible_fields','=',False)]}" /> days </div>
|
||||
<field name="used_once" />
|
||||
<field name="issuing_clearance_form" />
|
||||
<field name="issuing_deliver_custody" />
|
||||
<field name="check_annual_holiday"
|
||||
attrs="{'invisible':[('payslip_type','!=','unpaid')]}"/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
attrs="{'invisible':[('payslip_type','!=','unpaid')]}" />
|
||||
<field name="company_id" groups="base.group_multi_company"
|
||||
readonly="1" />
|
||||
|
||||
</group>
|
||||
</group>
|
||||
|
|
@ -81,58 +94,66 @@
|
|||
<group>
|
||||
<group name="selection" string="Validation">
|
||||
<!-- <field name="double_validation"/>-->
|
||||
<field name="active"/>
|
||||
<field name="active" />
|
||||
</group>
|
||||
<!--group name="second" string="Misc">
|
||||
<!--group
|
||||
name="second" string="Misc">
|
||||
<field name="color_name"/>
|
||||
|
||||
</group-->
|
||||
<group name="configuration" string="Payroll Configuration">
|
||||
<field name="payslip_type" required="1"/>
|
||||
<field name="type_unpaid" attrs="{'invisible': [('payslip_type','!=','unpaid')],
|
||||
<field name="payslip_type" required="1" />
|
||||
<field name="type_unpaid"
|
||||
attrs="{'invisible': [('payslip_type','!=','unpaid')],
|
||||
'required': [('payslip_type','=','unpaid')]}"
|
||||
string="Unpaid Types"/>
|
||||
<field name="period_giving_balance" attrs="{'invisible': ['|',('type_unpaid','!=','termination'),('payslip_type','!=','unpaid')],
|
||||
'required': [('type_unpaid','=','termination')]}"/>
|
||||
<field name="unpaid_leave_days_per_period" attrs="{'invisible': ['|',('type_unpaid','!=','termination'),('payslip_type','!=','unpaid')],
|
||||
'required': [('type_unpaid','=','termination')]}"/>
|
||||
string="Unpaid Types" />
|
||||
<field name="period_giving_balance"
|
||||
attrs="{'invisible': ['|',('type_unpaid','!=','termination'),('payslip_type','!=','unpaid')],
|
||||
'required': [('type_unpaid','=','termination')]}" />
|
||||
<field name="unpaid_leave_days_per_period"
|
||||
attrs="{'invisible': ['|',('type_unpaid','!=','termination'),('payslip_type','!=','unpaid')],
|
||||
'required': [('type_unpaid','=','termination')]}" />
|
||||
|
||||
<field name="period_unpaid_leave" attrs="{'invisible': ['|',('type_unpaid','!=','termination'),('payslip_type','!=','unpaid')],
|
||||
'required': [('type_unpaid','=','termination')]}"/>
|
||||
<field name="period_unpaid_leave"
|
||||
attrs="{'invisible': ['|',('type_unpaid','!=','termination'),('payslip_type','!=','unpaid')],
|
||||
'required': [('type_unpaid','=','termination')]}" />
|
||||
<field name="percentage"
|
||||
attrs="{'invisible': [('payslip_type','!=','percentage')],
|
||||
'required': [('payslip_type','=','percentage')]}"/>
|
||||
attrs="{'invisible': [('payslip_type','!=','percentage')],
|
||||
'required': [('payslip_type','=','percentage')]}" />
|
||||
<field name="salary_rules_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('payslip_type','not in',['addition','exclusion','reconcile'])],
|
||||
'required': [('payslip_type','in',['addition','exclusion','reconcile'])]}"/>
|
||||
attrs="{'invisible': [('payslip_type','not in',['addition','exclusion','reconcile'])],
|
||||
'required': [('payslip_type','in',['addition','exclusion','reconcile'])]}" />
|
||||
</group>
|
||||
<group name="overlimt" string="Over Limit">
|
||||
<field name="annual_holiday_id" domain="[('id', '!=', id),
|
||||
<field name="annual_holiday_id"
|
||||
domain="[('id', '!=', id),
|
||||
('active', '=', True),
|
||||
('payslip_type', '!=', 'unpaid')]"/>
|
||||
<field name="unpaid_holiday_id" domain="[('id', '!=', id),
|
||||
('payslip_type', '!=', 'unpaid')]" />
|
||||
<field name="unpaid_holiday_id"
|
||||
domain="[('id', '!=', id),
|
||||
('active', '=', True),
|
||||
('payslip_type', '=', 'unpaid')]"/>
|
||||
<field name="limit"/>
|
||||
('payslip_type', '=', 'unpaid')]" />
|
||||
<field name="limit" />
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Duration" attrs="{'invisible':[('leave_type','!=','annual')]}">
|
||||
<page string="Duration"
|
||||
attrs="{'invisible':[('leave_type','!=','annual')]}">
|
||||
<field name="duration_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="duration"/>
|
||||
<field name="name" />
|
||||
<field name="date_from" />
|
||||
<field name="date_to" />
|
||||
<field name="duration" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_follower_ids" widget="mail_followers" />
|
||||
<field name="activity_ids" widget="mail_activity" />
|
||||
<field name="message_ids" widget="mail_thread" />
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
|
|
@ -143,11 +164,11 @@
|
|||
<field name="model">hr.holiday.officials</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Official Holidays">
|
||||
<field name="official_event_id"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="religion"/>
|
||||
<field name="active"/>
|
||||
<field name="official_event_id" />
|
||||
<field name="date_from" />
|
||||
<field name="date_to" />
|
||||
<field name="religion" />
|
||||
<field name="active" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -158,29 +179,32 @@
|
|||
<form>
|
||||
<header>
|
||||
<button string="Confirm" name="confirm" type="object"
|
||||
attrs="{'invisible':['|',('state','!=','draft'),('active','=',False)]}"
|
||||
class="oe_highlight"/>
|
||||
attrs="{'invisible':['|',('state','!=','draft'),('active','=',False)]}"
|
||||
class="oe_highlight" />
|
||||
<button string="Reset to Draft" name="draft_state" type="object"
|
||||
states="refuse,confirm"
|
||||
class="oe_highlight" confirm="Are you sure to Reset To Draft This Record?"/>
|
||||
<button string="Refuse" name="refuse" confirm="Are you sure to refuse This Record?"
|
||||
states="draft" type="object" class="oe_highlight"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
states="refuse,confirm"
|
||||
class="oe_highlight"
|
||||
confirm="Are you sure to Reset To Draft This Record?" />
|
||||
<button string="Refuse" name="refuse"
|
||||
confirm="Are you sure to refuse This Record?"
|
||||
states="draft" type="object" class="oe_highlight" />
|
||||
<field name="state" widget="statusbar" />
|
||||
|
||||
</header>
|
||||
<sheet>
|
||||
<group col="4" colspan="2">
|
||||
<field name="official_event_id" colspan="4" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="date_from" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="active" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="date_to" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="religion" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="official_event_id" colspan="4"
|
||||
attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="date_from" attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="active" attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="date_to" attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
<field name="religion" attrs="{'readonly':[('state','!=','draft')]}" />
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_follower_ids" widget="mail_followers" />
|
||||
<field name="activity_ids" widget="mail_activity" />
|
||||
<field name="message_ids" widget="mail_thread" />
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
|
@ -191,12 +215,12 @@
|
|||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_hr_holidays_official"
|
||||
name="Official Holidays"
|
||||
parent="hr_holidays_public.menu_holidays_configuration"
|
||||
sequence="100"
|
||||
groups="hr_holidays_community.group_hr_holidays_manager"
|
||||
action="action_hr_holiday_officials"/>
|
||||
id="menu_hr_holidays_official"
|
||||
name="Official Holidays"
|
||||
parent="hr_holidays_public.menu_holidays_configuration"
|
||||
sequence="100"
|
||||
groups="hr_holidays_community.group_hr_holidays_manager"
|
||||
action="action_hr_holiday_officials" />
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
</odoo>
|
||||
Loading…
Reference in New Issue