diff --git a/soong_workflow/models/soong_workflow_record.py b/soong_workflow/models/soong_workflow_record.py index b969a0ebe..e4625d0fe 100644 --- a/soong_workflow/models/soong_workflow_record.py +++ b/soong_workflow/models/soong_workflow_record.py @@ -82,8 +82,8 @@ class SoongWorkflowRecord(models.Model): is_company = fields.Boolean(string="本公司", default=True, compute='_compute_is_company',search='_search_part_of_company') - # 节点更新时间(上一节点的结束时间) - node_update_time = fields.Datetime(string="节点更新时间") + # 办结时间(上一节点的结束时间) + node_update_time = fields.Datetime(string="办结时间") @api.depends_context('uid', 'company') @api.depends('company_id') diff --git a/soong_workflow/security/soong_workflow_security.xml b/soong_workflow/security/soong_workflow_security.xml index f6de335eb..53e5e05c4 100644 --- a/soong_workflow/security/soong_workflow_security.xml +++ b/soong_workflow/security/soong_workflow_security.xml @@ -8,10 +8,18 @@ User + + + 工作流--人事分组 + + + + + Manager - + @@ -38,17 +46,5 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/soong_workflow/static/src/css/record_scss.scss b/soong_workflow/static/src/css/record_scss.scss index cf994af51..ea7524cb1 100644 --- a/soong_workflow/static/src/css/record_scss.scss +++ b/soong_workflow/static/src/css/record_scss.scss @@ -19,4 +19,16 @@ } .o_comment_combined_input { flex: 2; +} + +.o_kanban_soong_wkf_record { + .o_kanban_record_headings { + flex: 1; + } + .o_kanban_record_bottom { + flex: 0 0 94px; + @include media-breakpoint-down(sm) { + flex: 0 0 56px; + } + } } \ No newline at end of file diff --git a/soong_workflow/templates/soong_workflow_templates.xml b/soong_workflow/templates/soong_workflow_templates.xml index 6a176b10f..7b2195461 100644 --- a/soong_workflow/templates/soong_workflow_templates.xml +++ b/soong_workflow/templates/soong_workflow_templates.xml @@ -175,21 +175,21 @@ -
+
- - 节点: - +
+ + 节点: + + + 状态: + +
- 状态: - -
-
- - 经办人: + 经办人:
@@ -197,7 +197,7 @@ 意见:
-
+
附件: diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml index 07ef8b71f..57b8f1623 100644 --- a/soong_workflow/views/soong_workflow_record.xml +++ b/soong_workflow/views/soong_workflow_record.xml @@ -243,7 +243,7 @@ decoration-danger="approve_state == 'end'" decoration-success="approve_state == 'pending'"/> - + @@ -252,7 +252,42 @@ invisible="not is_unlink"/>
diff --git a/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss b/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss index b48b3cd88..3847f6bd2 100644 --- a/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss +++ b/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss @@ -23,4 +23,9 @@ } .stat-change { font-size: 0.9rem; + } + + /* 下拉框placeholder样式 */ + #formview_default_conditions option[value=""] { + color: #6c757d; } \ No newline at end of file diff --git a/yuthon_salary/__manifest__.py b/yuthon_salary/__manifest__.py index ff35a9fca..5151f650f 100644 --- a/yuthon_salary/__manifest__.py +++ b/yuthon_salary/__manifest__.py @@ -43,6 +43,7 @@ 'wizard/temporary_payslip_wizard_views.xml', 'wizard/salary_import_wizard_views.xml', 'wizard/yuthon_payroll_wizard_views.xml', + 'wizard/salary_active_wizard_views.xml', 'wizard/basic_pension_wizard_views.xml', 'wizard/payroll_labor_wizard_views.xml', 'wizard/payroll_retired_wizard_views.xml', diff --git a/yuthon_salary/controllers/salary_phone.py b/yuthon_salary/controllers/salary_phone.py index 226e1be6a..477bf3cea 100644 --- a/yuthon_salary/controllers/salary_phone.py +++ b/yuthon_salary/controllers/salary_phone.py @@ -66,16 +66,16 @@ class YuthonWillTask(http.Controller): users_id = int(kw.get('users_id')) user = request.env['res.users'].sudo().browse(int(users_id)) employee_id = user.with_company(user.company_id.id).employee_id.id - records = request.env['hr.payslip'].sudo().search([('employee_id', '=', employee_id)]) + records = request.env['yuthon.salary.active'].sudo().search([('employee_id', '=', employee_id)]) data = {} for record in records: - year = record.date_from.year - month = record.date_from.month + year = int(record.select_year) + month = int(record.select_time) if year not in data.keys(): data[year] = {'total': 0} if month not in data[year].keys(): - data[year][month] = {'total': record.actual_salary} - data[year]['total'] += record.actual_salary + data[year][month] = {'total': record.actual_paid_salary} + data[year]['total'] += record.actual_paid_salary return json.dumps({'data': data, 'code': 200, 'message': ''}) @http.route('/phone/salary/self/detail', type='http', auth="none", csrf=False, cors='*') diff --git a/yuthon_salary/models/yuthon_salary_active.py b/yuthon_salary/models/yuthon_salary_active.py index b073b5a78..feb7b2511 100644 --- a/yuthon_salary/models/yuthon_salary_active.py +++ b/yuthon_salary/models/yuthon_salary_active.py @@ -99,14 +99,30 @@ class YuthonSalaryActive(models.Model): self.write({'confirm_status': 'un_confirm'}) def open_archive_record(self): - tree_id = self.env.ref("yuthon_salary.view_yuthon_salary_active_tree").id + self.ensure_one() + float_fields_with_value = [] + for field_name, field in self._fields.items(): + if field.type == 'float' and self[field_name] != 0 and self[field_name] is not False: + float_fields_with_value.append({ + 'field_name': field_name, + 'field_string': field.string, + 'field_value': self[field_name] + }) return { 'name': '工资条', 'type': 'ir.actions.act_window', - 'res_model': 'yuthon.salary.active', - 'views': [[tree_id, 'tree']], - 'view_mode': 'tree', - 'domain': [('employee_id', '=', self.employee_id.id)], + 'res_model': 'salary.active.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': { + 'default_actual_wages': self.actual_paid_salary, + 'default_select_year': self.select_year, + 'default_select_time': self.select_time, + 'default_active_line': [(0, 0, { + 'name': item['field_string'], + 'amount': item['field_value'] + }) for item in float_fields_with_value] + } } def _get_default_month(self): diff --git a/yuthon_salary/security/ir.model.access.csv b/yuthon_salary/security/ir.model.access.csv index 30abfad01..fd1c330c3 100644 --- a/yuthon_salary/security/ir.model.access.csv +++ b/yuthon_salary/security/ir.model.access.csv @@ -45,4 +45,7 @@ access_party_send_wizard,access_party_send_wizard,model_party_send_wizard,base.g access_yuthon_meal_expenses,access_yuthon_meal_expenses,model_yuthon_meal_expenses,base.group_user,1,1,1,1 access_party_meal_wizard,access_party_meal_wizard,model_party_meal_wizard,base.group_user,1,1,1,1 access_salary_meal_wizard,access_salary_meal_wizard,model_salary_meal_wizard,base.group_user,1,1,1,1 -access_yuthon_salary_active,access_yuthon_salary_active,model_yuthon_salary_active,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_salary_active,access_yuthon_salary_active,model_yuthon_salary_active,base.group_user,1,1,1,1 + +access_salary_active_wizard,access__salary_active_wizard,model_salary_active_wizard,base.group_user,1,1,1,1 +access_salary_active_line,access_salary_active_line,model_salary_active_line,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_salary/wizard/__init__.py b/yuthon_salary/wizard/__init__.py index 13f4bc72d..171ff8854 100644 --- a/yuthon_salary/wizard/__init__.py +++ b/yuthon_salary/wizard/__init__.py @@ -17,4 +17,5 @@ from . import salary_party_wizard from . import salary_import_wizard from . import party_send_wizard from . import party_meal_wizard -from . import salary_meal_wizard \ No newline at end of file +from . import salary_meal_wizard +from . import salary_active_wizard \ No newline at end of file diff --git a/yuthon_salary/wizard/salary_active_wizard.py b/yuthon_salary/wizard/salary_active_wizard.py new file mode 100644 index 000000000..0a45e3059 --- /dev/null +++ b/yuthon_salary/wizard/salary_active_wizard.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +from dateutil.relativedelta import relativedelta + +from odoo import models, fields, api, _, SUPERUSER_ID +from odoo.exceptions import ValidationError, UserError +from odoo.exceptions import ValidationError +import calendar +from pypinyin import pinyin, Style +import math +import xlrd +import base64 +import datetime +from datetime import datetime, timedelta + + +class SalaryActiveWizard(models.TransientModel): + _name = 'salary.active.wizard' + _description = '工资条查询' + + active_line = fields.One2many('salary.active.line', 'active_id', string='明细') + select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'), + ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'), + ('9', '九月'), ('10', '十月'), ('11', '十一月'), + ('12', '十二月')], string='月份', + default=lambda self: self._get_default_month()) + select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2040)], string='年份') + select_name = fields.Char(compute='_get_default_name') + actual_wages = fields.Float(string='实发工资') + + @api.depends('select_year', 'select_time') + def _get_default_name(self): + for rec in self: + rec.select_name = rec.select_year + '年' + rec.select_time + '月' + + +class SalaryActiveLine(models.TransientModel): + _name = 'salary.active.line' + _description = '明细' + + sequence = fields.Char(string='序号', store=True) + active_id = fields.Many2one('salary.active.wizard', string='工资条') + name = fields.Char(string='工资条') + amount = fields.Float(string='金额') \ No newline at end of file diff --git a/yuthon_salary/wizard/salary_active_wizard_views.xml b/yuthon_salary/wizard/salary_active_wizard_views.xml new file mode 100644 index 000000000..3bdb64f6b --- /dev/null +++ b/yuthon_salary/wizard/salary_active_wizard_views.xml @@ -0,0 +1,33 @@ + + + + 工资条查询 + salary.active.wizard + +
+ + + + +
+ +
+ +

+ +

+
+
+ + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/yuthon_will_task/controllers/main.py b/yuthon_will_task/controllers/main.py index 2857a875b..3d01ae9b4 100644 --- a/yuthon_will_task/controllers/main.py +++ b/yuthon_will_task/controllers/main.py @@ -73,12 +73,10 @@ class YuthonWillTask(http.Controller): @http.route('/will/task/list', methods=['POST'], type='http', auth='public', csrf=False) def will_task_list(self, **kwargs): - employee_id = request.env['hr.employee'].search([('user_id', '=', int(kwargs.get('users_id')))]) start = kwargs.get('start') request_hour_selection = request.env['yuthon.will.task'].sudo().fields_get(allfields=['request_hour_from'])['request_hour_from']['selection'] result_list = [] - # task_ids = request.env['yuthon.will.task'].sudo().search([], offset=start, limit=20) - task_ids = request.env['yuthon.will.task'].sudo().search(['|', ('employee_ids', 'in', employee_id.id), ('employee_id.id', '=', employee_id.id)], offset=start, limit=20) + task_ids = request.env['yuthon.will.task'].sudo().search([('users_ids', 'in', [int(kwargs.get('users_id'))])], offset=start, limit=20) for task in task_ids: weekday_str = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"][task.start_date.weekday()] result = { diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index fb82d3c0f..9d89f5109 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -166,17 +166,17 @@ sequence="14"/> @@ -311,6 +311,11 @@ parent="attendance_resources_setting_root_board" action="hr_holidays.hr_leave_allocation_action_approve_department" sequence="20"/> + - + @@ -762,7 +767,7 @@ - +