diff --git a/yuthon_holiday/models/yuthon_vacation_reports.py b/yuthon_holiday/models/yuthon_vacation_reports.py index 05509abd1..6b6584dd5 100644 --- a/yuthon_holiday/models/yuthon_vacation_reports.py +++ b/yuthon_holiday/models/yuthon_vacation_reports.py @@ -12,7 +12,10 @@ class YuthonVacationReports(models.Model): company_id = fields.Many2one(related="employee_id.company_id", string="公司") leave = fields.Float(string='年假') working_overtime = fields.Float(string='加班时') - meal_fee = fields.Integer(string="误餐费") + meal_fee = fields.Integer(string="误餐次数") + leave_ids = fields.One2many('vacation.leave.line', 'vacation_id', string='年假明细') + overtime_ids = fields.One2many('vacation.over.line', 'vacation_id', string='加班明细') + meal_fee_ids = fields.One2many('vacation.meal.line', 'vacation_id', string='误餐明细') def button_fixes_approval(self): form_id = self.env.ref('yuthon_holiday.view_yuthon_fixes_approval_form').id @@ -37,8 +40,9 @@ class YuthonVacationReports(models.Model): 'res_model': 'soong.workflow.record', 'view_mode': 'tree', 'domain': domain, - 'context': {'group_by': ['workflow_id']} - } + 'context': {'group_by': ['workflow_id'], + 'tree_view_ref':'yuthon_holiday.details_tree_view', + }} return action def update_vacation(self): @@ -66,6 +70,55 @@ class YuthonVacationReports(models.Model): }) + def log(self): + return { + "type": "ir.actions.act_window", + "res_model": 'yuthon.vacation.reports', + "res_id": self.id, + "name": "详情", + "view_mode": "form", + } + + +class VacationLeaveLine(models.Model): + _name = 'vacation.leave.line' + _description = '年假明细' + + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') + update_date = fields.Date(string='更新时间') + update_lines = fields.Text(string='更新额度') + + +class VacationOverline(models.Model): + _name = 'vacation.over.line' + _description = '加班明细' + + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') + update_date = fields.Date(string='更新时间') + update_lines = fields.Text(string='更新额度') + + +class VacationMealLine(models.Model): + _name = 'vacation.meal.line' + _description = '误餐明细' + + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') + update_date = fields.Date(string='更新时间') + update_lines = fields.Text(string='更新额度') + + +class DetailsTree(models.Model): + _name = 'details.tree' + _description = '明细表' + + code = fields.Char() + name = fields.Char() + + + diff --git a/yuthon_holiday/security/ir.model.access.csv b/yuthon_holiday/security/ir.model.access.csv index 08ace331c..07834f674 100644 --- a/yuthon_holiday/security/ir.model.access.csv +++ b/yuthon_holiday/security/ir.model.access.csv @@ -7,3 +7,7 @@ access_yuthon_holiday_setting,yuthon_holiday_setting,model_yuthon_holiday_settin access_leave_allocation_wizard,leave_allocation_wizard,model_leave_allocation_wizard,base.group_user,1,1,1,1 access_yuthon_leave_wizard,yuthon_leave_wizard,model_yuthon_leave_wizard,base.group_user,1,1,1,1 access_yuthon_vacation_reports,yuthon_vacation_reports,model_yuthon_vacation_reports,base.group_user,1,1,1,1 +access_vacation_leave_line,vacation_leave_line,model_vacation_leave_line,base.group_user,1,1,1,1 +access_vacation_meal_line,vacation_meal_line,model_vacation_meal_line,base.group_user,1,1,1,1 +access_vacation_over_line,vacation_over_line,model_vacation_over_line,base.group_user,1,1,1,1 +access_details_tree, details_tree,model_details_tree,base.group_user,1,1,1,1 diff --git a/yuthon_holiday/views/yuthon_vacation_reports_views.xml b/yuthon_holiday/views/yuthon_vacation_reports_views.xml index ed9f2284e..8353e9459 100644 --- a/yuthon_holiday/views/yuthon_vacation_reports_views.xml +++ b/yuthon_holiday/views/yuthon_vacation_reports_views.xml @@ -12,13 +12,56 @@