添加功能

This commit is contained in:
李鹏宇
2025-12-01 14:44:40 +08:00
parent 33feda92c8
commit 8c881dc94f
5 changed files with 21 additions and 16 deletions
@@ -16,8 +16,9 @@ class YuthonVacationReports(models.Model):
_order = "vacation_date desc"
employee_id = fields.Many2one('hr.employee', string='员工')
department_id = fields.Many2one(related='employee_id.department_id', string="部门")
company_id = fields.Many2one(related="employee_id.company_id", string="公司")
salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资单分组", store=True)
department_id = fields.Many2one(related='employee_id.department_id', string="部门", store=True)
company_id = fields.Many2one(related="employee_id.company_id", string="公司", store=True)
late_allowed = fields.Float(related="employee_id.late_allowed", string="允许迟到次数")
leave_ids = fields.One2many('vacation.leave.line', 'vacation_id', string='年假明细')
overtime_ids = fields.One2many('vacation.over.line', 'vacation_id', string='加班明细')
@@ -182,12 +183,11 @@ class YuthonVacationReports(models.Model):
month = rec.vacation_date.month
month_start = date(year, month, 1)
entry_date = rec.employee_id.entry_date
days_in_month = calendar.monthrange(year, month)[1]
if not entry_date or month_start > entry_date:
start_day = 1
else:
days_in_month = (date(year, month + 1, 1) - timedelta(days=1)).day
start_day = min(entry_date.day, days_in_month)
days_in_month = (date(year, month + 1, 1) - timedelta(days=1)).day
actual_days_range = range(start_day, days_in_month + 1)
for day in actual_days_range:
current_date = date(year, month, day)
@@ -284,6 +284,9 @@
<search>
<field name="employee_id"/>
<group expand="0" string="Group By">
<filter string="公司" name="group_by_company_id" domain="[]" context="{'group_by': 'company_id'}"/>
<filter string="部门" name="group_by_department_id" domain="[]" context="{'group_by': 'department_id'}"/>
<filter string="工资组" name="group_by_salary_group_id" domain="[]" context="{'group_by': 'salary_group_id'}"/>
<filter string="员工" name="group_by_employee_id" domain="[]" context="{'group_by': 'employee_id'}"/>
<filter string="按年" name="group_by_vacation_year" domain="[]" context="{'group_by': 'vacation_date:year'}"/>
<filter string="按月" name="group_by_vacation_month" domain="[]" context="{'group_by': 'vacation_date:month'}"/>
@@ -591,7 +591,13 @@ class PropertyLeaseContract(models.Model):
def action_open_contract(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id("yuthon_property_approval.property_accounts_receivable_action")
action.update({'domain': [('contract_id', '=', self.id)]})
action.update({
'domain': [('contract_id', '=', self.id)],
'context': {
'search_default_group_by_management_type_id': 1,
'group_by': 'management_type_id'
}
})
return action
def action_open_reconciliation(self):
@@ -63,7 +63,13 @@ class SalaryComputeWizard(models.Model):
('contract_id.termination_date', '=', False),
('contract_id.date_end', '=', False)
])
last_day1 = (datetime(year, month + 1, 1) - timedelta(days=1)).strftime('%Y-%m-%d')
if month == 12:
next_year = year + 1
next_month = 1
else:
next_year = year
next_month = month + 1
last_day1 = (datetime(next_year, next_month, 1) - timedelta(days=1)).strftime('%Y-%m-%d')
existing_employees = self.env['hr.payslip'].search([
('date_from', '>=', first_day),
('date_to', '<=', last_day1),
-10
View File
@@ -639,16 +639,6 @@
parent="holiday_manage_menu_root_board"
action="soong_workflow.soong_workflow_record_my_action"
sequence="2"/>
<!-- <menuitem id="menu_workflow_approval_request_my_to_approval"-->
<!-- name="待办"-->
<!-- parent="menu_workflow_approval_request_my_start"-->
<!-- action="soong_workflow.soong_workflow_record_my_to_action"-->
<!-- sequence="1"/>-->
<!-- <menuitem id="menu_workflow_approval_request_my_done_approval"-->
<!-- name="已办"-->
<!-- parent="menu_workflow_approval_request_my_start"-->
<!-- action="soong_workflow.soong_workflow_record_my_done_action"-->
<!-- sequence="5"/>-->
<menuitem id="yuthon_notice_menu1_board"
parent="holiday_manage_menu_root_board"