Merge branch 'dev_odex25_hr' of https://github.com/expsa/odex25-standard-modules into bakry_hr
This commit is contained in:
commit
7b2d5c18e0
|
|
@ -246,15 +246,15 @@ class HrAttendanceReport(models.Model):
|
|||
'absent': actual_absent_hours + missing_punch_hours + break_hours + early_exit_hours + lateness_hours ,
|
||||
'mission_by_days': total_mission,
|
||||
'absent_days_by_hr': 0.0,
|
||||
'total_hours': missed_hours,
|
||||
'total_hours': missed_hours + missing_punch_hours,
|
||||
'dummy_field': missed_hours,
|
||||
'actual_absent_hours': actual_absent_hours,
|
||||
'total_permission_hours':total_permission_hours,
|
||||
'missing_punch_hours':missing_punch_hours ,
|
||||
'total_amount': employee.contract_id.total_allowance,
|
||||
'amount_per_hour': employee.contract_id.total_allowance / working_hours_flexible_days,
|
||||
'total_deduction': missed_hours * (
|
||||
employee.contract_id.total_allowance / working_hours_flexible_days)
|
||||
'total_deduction': ((missed_hours+ missing_punch_hours) * (
|
||||
employee.contract_id.total_allowance / working_hours_flexible_days))
|
||||
}
|
||||
item_list.append(values)
|
||||
elif not emp_calendar.is_flexible:
|
||||
|
|
@ -345,11 +345,11 @@ class HrAttendanceReport(models.Model):
|
|||
'absent': actual_absent_hours + missing_punch_hours + lateness + early_exist + extra_break_duration,
|
||||
'mission_by_days': total_mission_by_day,
|
||||
'absent_days_by_hr': lateness_hours_by_hr,
|
||||
'total_hours': get_total_hours,
|
||||
'total_hours': get_total_hours + missing_punch_hours,
|
||||
'dummy_field': get_total_hours,
|
||||
'total_amount': get_total_amount,
|
||||
'amount_per_hour': get_amount_per_hour,
|
||||
'total_deduction': get_total_hours * get_amount_per_hour,
|
||||
'total_deduction': (get_total_hours + missing_punch_hours)* get_amount_per_hour,
|
||||
'additional_hours': additional_hours,
|
||||
'actual_absent_hours':actual_absent_hours,
|
||||
'total_permission_hours':total_permission_hours,
|
||||
|
|
|
|||
|
|
@ -412,16 +412,34 @@ class HrAttendanceTransactions(models.Model):
|
|||
time_list[7] = two_sp_timing and two_sp_timing.end_sign_out or calendar.shift_two_max_sign_out
|
||||
return time_list, planed_hours
|
||||
|
||||
# def get_speacial_day_timing(self, calender, weekday, at_date, shift=None):
|
||||
# sp_days = shift and calender.special_days_partcial or calender.special_days
|
||||
# for spday in sp_days:
|
||||
# if spday.name.lower() == weekday and ((shift and spday.shift == shift) or (not shift and True)):
|
||||
# if spday.date_from and spday.date_to \
|
||||
# and str(at_date) >= spday.date_from and str(at_date) <= spday.date_to:
|
||||
# return spday
|
||||
# elif spday.date_from and not spday.date_to and str(at_date) >= spday.date_from:
|
||||
# return spday
|
||||
# elif not spday.date_from and spday.date_to and str(at_date) <= spday.date_to:
|
||||
# return spday
|
||||
# elif not spday.date_from and not spday.date_to:
|
||||
# return spday
|
||||
|
||||
def get_speacial_day_timing(self, calender, weekday, at_date, shift=None):
|
||||
# Ensure at_date is a date object
|
||||
if isinstance(at_date, str):
|
||||
# Adjust the format string to match your date string format
|
||||
at_date = datetime.strptime(at_date, "%Y-%m-%d").date()
|
||||
sp_days = shift and calender.special_days_partcial or calender.special_days
|
||||
for spday in sp_days:
|
||||
if spday.name.lower() == weekday and ((shift and spday.shift == shift) or (not shift and True)):
|
||||
if spday.date_from and spday.date_to \
|
||||
and str(at_date) >= spday.date_from and str(at_date) <= spday.date_to:
|
||||
and at_date >= spday.date_from and at_date <= spday.date_to:
|
||||
return spday
|
||||
elif spday.date_from and not spday.date_to and str(at_date) >= spday.date_from:
|
||||
elif spday.date_from and not spday.date_to and at_date >= spday.date_from:
|
||||
return spday
|
||||
elif not spday.date_from and spday.date_to and str(at_date) <= spday.date_to:
|
||||
elif not spday.date_from and spday.date_to and at_date <= spday.date_to:
|
||||
return spday
|
||||
elif not spday.date_from and not spday.date_to:
|
||||
return spday
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="employee_cost_report_form">
|
||||
<field name="name">employee.cost.report.form</field>
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
id="employee_request_root_report_menu"
|
||||
name="Reports"
|
||||
parent="employee_requests.employee_request_menu_item"
|
||||
groups="hr.group_hr_user"/>
|
||||
groups="hr.group_hr_user"/>
|
||||
|
||||
<record id="employee_overtime_report_action" model="ir.actions.act_window">
|
||||
<field name="name">Overtime /Month</field>
|
||||
|
|
@ -205,6 +205,8 @@
|
|||
<menuitem
|
||||
id="loan_report_menu"
|
||||
name="Loan Report"
|
||||
groups="hr_loans_salary_advance.group_loan_manager,hr_loans_salary_advance.group_loan_user"
|
||||
|
||||
parent="loan_report_root_menu"
|
||||
action="loan_report_actions"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -11,9 +11,12 @@
|
|||
<header position="replace">
|
||||
<header>
|
||||
<button name="program_directory" string="program Director" class="oe_highlight" type="object"
|
||||
states="hr_head_approval" groups="hr_base.group_executive_manager"/>
|
||||
<button name="hr_head_approval" string="HR Head Approval" class="oe_highlight"
|
||||
type="object" states="employeed_aproval" groups="hr.group_hr_manager"/>
|
||||
states="employeed_aproval" groups="hr.group_hr_manager"/>
|
||||
<!-- states="employeed_aproval" groups="hr_base.group_executive_manager"/>-->
|
||||
|
||||
<!-- <button name="hr_head_approval" string="HR Head Approval" class="oe_highlight"-->
|
||||
<!-- type="object" states="employeed_aproval" groups="hr.group_hr_manager"/>-->
|
||||
|
||||
<button name="employeed_aproval" string="Employee Approval" class="oe_highlight"
|
||||
type="object" states="draft" groups="hr.group_hr_user"/>
|
||||
<button name="end_contract_state" string="End Contract" class="oe_highlight"
|
||||
|
|
@ -22,8 +25,11 @@
|
|||
type="object" attrs="{'invisible':[('state','=','draft')]}" groups="hr.group_hr_user"/>
|
||||
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,employeed_aproval,hr_head_approval,program_directory,end_contract"/>
|
||||
statusbar_visible="draft,employeed_aproval,program_directory,end_contract"/>
|
||||
</header>
|
||||
|
||||
<!-- statusbar_visible="draft,employeed_aproval,hr_head_approval,program_directory,end_contract"/>-->
|
||||
<!-- -->
|
||||
</header>
|
||||
|
||||
<field name="employee_id" position="replace"/>
|
||||
|
|
@ -288,6 +294,7 @@
|
|||
>
|
||||
<field name="name"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="job_id"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="emp_type"/>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<field name="domain_force">[(1 ,'=', 1)]</field>
|
||||
<field name="groups" eval="[(4, ref('hr_base.group_executive_manager')),
|
||||
(4, ref('hr_base.group_general_manager')),
|
||||
(4, ref('hr.group_hr_manager')),
|
||||
(4, ref('hr_loans_salary_advance.group_loan_manager')),
|
||||
(4, ref('hr_loans_salary_advance.group_loan_user'))]"/>
|
||||
</record>
|
||||
|
||||
|
|
@ -78,11 +78,14 @@
|
|||
<field name="model_id" ref="model_hr_loan_payment_suspension"/>
|
||||
<field name="domain_force">[(1 ,'=', 1)]</field>
|
||||
<field name="groups" eval="[(4, ref('hr_base.group_general_manager')),
|
||||
(4, ref('hr.group_hr_manager')),
|
||||
(4, ref('hr.group_hr_user')),
|
||||
(4, ref('hr_base.group_executive_manager')),
|
||||
(4, ref('hr_loans_salary_advance.group_loan_manager')),
|
||||
(4, ref('hr_loans_salary_advance.group_loan_user'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- (4, ref('hr.group_hr_manager')),
|
||||
(4, ref('hr.group_hr_user')),-->
|
||||
|
||||
<record id="hr_loan_payment_suspension_multi_company_rule" model="ir.rule">
|
||||
<field name="name">Employee loan payment suspension multi-company rule</field>
|
||||
<field name="model_id" ref="model_hr_loan_payment_suspension"/>
|
||||
|
|
|
|||
|
|
@ -191,8 +191,12 @@
|
|||
|
||||
<!-- Loans menu -->
|
||||
<menuitem id="loans_menu_id" name="Employee Loans" parent="hr.menu_hr_root" sequence="3"/>
|
||||
<menuitem name="Loans/Salary Advance" id="employee_loan_salary_menu_item"
|
||||
<menuitem name="Loans/Salary Advance"
|
||||
|
||||
id="employee_loan_salary_menu_item"
|
||||
parent="loans_menu_id"
|
||||
groups="hr_loans_salary_advance.group_loan_manager,hr_loans_salary_advance.group_loan_user"
|
||||
|
||||
action="employee_loan_salary_list_action" sequence="1"/>
|
||||
|
||||
</data>
|
||||
|
|
|
|||
Loading…
Reference in New Issue