From a51f01756ae212d1092b467f8ef3248690fb68f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 11:35:14 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_property_approval/wizard/penalty_line_wizard.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yuthon_property_approval/wizard/penalty_line_wizard.py b/yuthon_property_approval/wizard/penalty_line_wizard.py index 88800d163..36ee0b30a 100644 --- a/yuthon_property_approval/wizard/penalty_line_wizard.py +++ b/yuthon_property_approval/wizard/penalty_line_wizard.py @@ -129,10 +129,13 @@ class PenaltyLineWizard(models.Model): # 计算剩余本金 remaining_principal = max(0, pay_line.not_collected - pay_amount) penalty_start_date = pay_date - + if is_penalty: + remake = f'支付违约金¥{pay_line.amount}' + else: + remake = f'支付金额¥{pay_line.amount}' new_penalty_lines.append((0, 0, { 'date': pay_date, - 'remake': f'支付金额¥{pay_line.amount}', + 'remake':remake, 'days_overdue': days_overdue, 'remaining_principal': remaining_principal, 'penalty': round(current_penalty, 2), From 4402f66d979ab696ee897c4d6a3145034c478367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 11:39:59 +0800 Subject: [PATCH 02/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_property_approval/wizard/penalty_line_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_property_approval/wizard/penalty_line_wizard.py b/yuthon_property_approval/wizard/penalty_line_wizard.py index 36ee0b30a..fb7f39025 100644 --- a/yuthon_property_approval/wizard/penalty_line_wizard.py +++ b/yuthon_property_approval/wizard/penalty_line_wizard.py @@ -199,7 +199,7 @@ class PenaltyLineWizard(models.Model): 'date': self.calculation_date, 'days_overdue': days_overdue, 'remaining_principal': prev_line.remaining_principal, - 'remake': f'{base_date}至{self.calculation_date}', + 'remake': f'违约金:{base_date}至{self.calculation_date}', 'penalty': round(current_penalty, 2), 'is_realtime': True, })) From c80af2bc7ed8f3b5fffa567b8ada1397439d011b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 11:57:27 +0800 Subject: [PATCH 03/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/applet_attendance.py | 17 ++++++++++++++--- .../models/yuthon_employee_setting.py | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 2056e7b68..2bf14d1f2 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -889,15 +889,26 @@ class AppletAttendance(Controller): last_day_str = last_day.strftime('%Y-%m-%d') two_months_ago = datetime.now().date() - relativedelta(months=2) # 去掉 数据为 0 的数据. - valid_archives_ids = request.env(user=SUPERUSER_ID)['property.meter.archives'].search([ + valid_archives = request.env(user=SUPERUSER_ID)['property.meter.archives'].search([ ('is_virtual_meter', '!=', True), '|', ('end_time', '=', False), ('end_time', '<=', two_months_ago) - ]).ids + ]) + + valid_archives_names = [arch.name or "未命名电表库" for arch in valid_archives] + valid_archives_count = len(valid_archives_names) + _logger.info( + "【电表库过滤】查询条件:非虚拟电表 + (无拆除日期 或 拆除日期≤%s);" + "符合条件的电表库数量:%d;电表库名称列表:%s", + two_months_ago, + valid_archives_count, + valid_archives_names if valid_archives_count > 0 else "无" + ) + electric_records = request.env(user=SUPERUSER_ID)['meter.archives.line'].search([ ('archives_state', '!=', 'stop'), - ('archives_id', 'in', valid_archives_ids), + ('archives_id', 'in', valid_archives.ids), ('meter_date', '>=', first_day_str), ('meter_date', '<=', last_day_str), ]) diff --git a/yuthon_hr_employee_approval/models/yuthon_employee_setting.py b/yuthon_hr_employee_approval/models/yuthon_employee_setting.py index 591a681c8..889c36df6 100644 --- a/yuthon_hr_employee_approval/models/yuthon_employee_setting.py +++ b/yuthon_hr_employee_approval/models/yuthon_employee_setting.py @@ -6,4 +6,4 @@ class YuthonServiceType(models.Model): _name = 'yuthon.service.type' _description = '服务类型' - name = fields.Char(string="名称") + name = fields.Char(string="名称") \ No newline at end of file From e04616421bf159634b7f2c8084c2b781c2b2c15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 12:02:38 +0800 Subject: [PATCH 04/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/applet_attendance.py | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 2bf14d1f2..a21eee297 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -895,17 +895,6 @@ class AppletAttendance(Controller): ('end_time', '=', False), ('end_time', '<=', two_months_ago) ]) - - valid_archives_names = [arch.name or "未命名电表库" for arch in valid_archives] - valid_archives_count = len(valid_archives_names) - _logger.info( - "【电表库过滤】查询条件:非虚拟电表 + (无拆除日期 或 拆除日期≤%s);" - "符合条件的电表库数量:%d;电表库名称列表:%s", - two_months_ago, - valid_archives_count, - valid_archives_names if valid_archives_count > 0 else "无" - ) - electric_records = request.env(user=SUPERUSER_ID)['meter.archives.line'].search([ ('archives_state', '!=', 'stop'), ('archives_id', 'in', valid_archives.ids), @@ -1082,14 +1071,21 @@ class AppletAttendance(Controller): # ('meter_date', '>=', first_day_str), # ('meter_date', '<=', last_day_str)] - # 去掉 state - domain = [('epitope_values_id.name', '=', floor_name), - ('meter_date', '>=', first_day_str), - ('meter_date', '<=', last_day_str)] - + domain = [ + ('epitope_values_id.name', '=', floor_name), + ('meter_date', '>=', first_day_str), + ('meter_date', '<=', last_day_str) + ] + two_months_ago = datetime.now().date() - relativedelta(months=2) if type == 'electric': domain.append(('archives_state', '!=', 'stop')) model = 'meter.archives.line' + domain.extend([ + ('archives_id.is_virtual_meter', '!=', True), + '|', + ('archives_id.end_time', '=', False), + ('archives_id.end_time', '<=', two_months_ago) + ]) else: domain.append(('water_state', '!=', 'stop')) model = 'meter.water.line' From be3ea250fbf4a4c2de14fd5df7f85583b61a9a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 14:33:47 +0800 Subject: [PATCH 05/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/yuthon_hr_employee.py | 22 +++++++++++++++++++ .../wizard/property_reconciliation_wizard.py | 2 ++ 2 files changed, 24 insertions(+) diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index c7d1b7bfe..051661af5 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -286,6 +286,28 @@ class YuthonHrEmployee(models.Model): else: record.date_end = None + def renew(self): + employee_ids = self.env["hr.employee"].browse( + self._context.get("active_ids", self._context.get("active_id")) + ) + for record in employee_ids: + if len(record) > 1: + raise UserError("只能选择一个员工续签") + return { + "name": "续签", + "type": "ir.actions.act_window", + "res_model": "yuthon.renewal.approval", + "view_mode": "form", + "context": { + "default_employee_id": self.employee_id.id, + "default_current_status": self.employee_id.contract_id.date_end, + "default_department1_id": self.employee_id.department_id.id, + "default_contract_id": self.employee_id.contract_id.id, + }, + } + + + def update_social_base(self): current_year = fields.Date.today().year group_company = self.env['res.company'].search([('name', '=', '集团本部')], limit=1) diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index a25031ea2..df19bfe17 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -538,6 +538,8 @@ class PropertyReconciliationWizard(models.Model): ] # 检查是否已有相同记录 existing_record = self.env['property.accounts.receivable'].search(check_domain) + if len(existing_record)>1: + raise UserError(f'合同{line.contract_id.contract_code}应收日期为{line.due_date}的违约金存在多条相同记录,请检查数据') is_reconciliation = round(line.amount,2) == round(line.rent, 2) receivable_id = self.env['property.accounts.receivable'] if not existing_record and is_create: From acdf344fb0d8327f59a78082e778f7f873103ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 14:45:49 +0800 Subject: [PATCH 06/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wizard/property_reconciliation_wizard.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index df19bfe17..1980fe84b 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -538,8 +538,6 @@ class PropertyReconciliationWizard(models.Model): ] # 检查是否已有相同记录 existing_record = self.env['property.accounts.receivable'].search(check_domain) - if len(existing_record)>1: - raise UserError(f'合同{line.contract_id.contract_code}应收日期为{line.due_date}的违约金存在多条相同记录,请检查数据') is_reconciliation = round(line.amount,2) == round(line.rent, 2) receivable_id = self.env['property.accounts.receivable'] if not existing_record and is_create: @@ -588,9 +586,13 @@ class PropertyReconciliationWizard(models.Model): 'is_write': True if line.amount != 0 else False, 'is_penalty': True, 'reconciliation_date': rec.actual_date if line.amount != 0 else None, - 'receivable_id': receivable_id.id, + 'receivable_id': receivable_id[0].id, 'amount': line.amount, }) + # 删除多余的违约金数据 + if len(receivable_id) > 1: + receivable_id = existing_record[1:] + receivable_id.unlink() rec.amount_been_reconciled += line.amount yes_amount += line.amount @@ -609,7 +611,6 @@ class PropertyReconciliationWizard(models.Model): if unreconciled_receivables: remaining_contract_ids.append(contract.id) - class PropertyReconciliationLine(models.Model): _name = 'property.reconciliation.line' _description = '对账明细' From 3f51aba487a3868bc7b72aa4ea5842e136f98671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 15:47:33 +0800 Subject: [PATCH 07/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_issue/models/issue_approval_decision.py | 1 + yuthon_issue/views/issue_approval_decision_views.xml | 8 +++++--- yuthon_maintain/models/property_device_repair.py | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/yuthon_issue/models/issue_approval_decision.py b/yuthon_issue/models/issue_approval_decision.py index 40e941104..fe423ce41 100644 --- a/yuthon_issue/models/issue_approval_decision.py +++ b/yuthon_issue/models/issue_approval_decision.py @@ -27,6 +27,7 @@ class IssueApprovalDecision(models.Model): end_date = fields.Date(string="失效日期") remarks = fields.Text(string='备注') issue_approval_id = fields.Many2one('issue.approval', string="关联议题审批") + version = fields.Char(string="版本", default="V3.0") def _get_default_company(self): company = self.env['res.company'].search([('name', '=', '集团本部')], limit=1) diff --git a/yuthon_issue/views/issue_approval_decision_views.xml b/yuthon_issue/views/issue_approval_decision_views.xml index 11f01459e..8bc051342 100644 --- a/yuthon_issue/views/issue_approval_decision_views.xml +++ b/yuthon_issue/views/issue_approval_decision_views.xml @@ -20,6 +20,7 @@ + @@ -47,14 +48,14 @@ - - - + + + @@ -62,6 +63,7 @@ + diff --git a/yuthon_maintain/models/property_device_repair.py b/yuthon_maintain/models/property_device_repair.py index 951e84e2e..9078e2f8a 100644 --- a/yuthon_maintain/models/property_device_repair.py +++ b/yuthon_maintain/models/property_device_repair.py @@ -18,7 +18,6 @@ class PropertyDeviceRelief(models.Model): company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司") software_processing_id = fields.Many2one('software.issues.processing', string="设备类型") problem_description = fields.Text(string="问题描述") - remake = fields.Text(string="问题描述") report_state = fields.Selection([('to', '待处理'), ('done', '已处理')], string='状态', default='to') create_time = fields.Date(string="填报日期", default=fields.Datetime.now) urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', @@ -38,7 +37,7 @@ class PropertyDeviceRelief(models.Model): def _compute_name(self): for rec in self: if rec.users_id and rec.software_processing_id: - rec.name = f" {rec.software_processing_id.name}-{rec.users_id.name}-{rec.remake}" + rec.name = f"{rec.users_id.name}-{rec.software_processing_id.name}-{rec.problem_description}" def get_no_read_count(self): From f2410593706338592cf623d8d5151ccfca9bea8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 16:44:24 +0800 Subject: [PATCH 08/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_maintain/models/property_device_repair.py | 14 +++++++++++++- .../views/property_device_repair_views.xml | 10 +++++++--- yuthon_will_task/views/yuthon_will_task_views.xml | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/yuthon_maintain/models/property_device_repair.py b/yuthon_maintain/models/property_device_repair.py index 9078e2f8a..dbe632474 100644 --- a/yuthon_maintain/models/property_device_repair.py +++ b/yuthon_maintain/models/property_device_repair.py @@ -18,7 +18,7 @@ class PropertyDeviceRelief(models.Model): company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司") software_processing_id = fields.Many2one('software.issues.processing', string="设备类型") problem_description = fields.Text(string="问题描述") - report_state = fields.Selection([('to', '待处理'), ('done', '已处理')], string='状态', default='to') + report_state = fields.Selection([('to_submitted', '待提交'), ('to', '待处理'), ('done', '已处理')], string='状态', default='to_submitted') create_time = fields.Date(string="填报日期", default=fields.Datetime.now) urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', default='normal') @@ -39,12 +39,24 @@ class PropertyDeviceRelief(models.Model): if rec.users_id and rec.software_processing_id: rec.name = f"{rec.users_id.name}-{rec.software_processing_id.name}-{rec.problem_description}" + def device_delete(self): + self.unlink() + + def open_record(self): + return { + "type": "ir.actions.act_window", + "res_model": 'processing.order.approval', + "res_id": self.processing_order_id.id, + "name": '详情', + "view_mode": "form", + } def get_no_read_count(self): return self.search_count([('report_state', '=', 'to')]) def pull_order(self): soong_workflow_line_list = [] + self.report_state = 'to' if self.env['processing.order.approval'].search([('device_id', '=', self.id)]): raise UserError('该设备已生成处理单') order_id = self.env['processing.order.approval'].create({ diff --git a/yuthon_maintain/views/property_device_repair_views.xml b/yuthon_maintain/views/property_device_repair_views.xml index 63af193ca..0f73b7abf 100644 --- a/yuthon_maintain/views/property_device_repair_views.xml +++ b/yuthon_maintain/views/property_device_repair_views.xml @@ -4,13 +4,15 @@ property.device.repair.tree property.device.repair - + -