From 0ad0eebaa4c79f934c8d5c86b25d764d65666243 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Thu, 20 Mar 2025 17:16:06 +0800
Subject: [PATCH] =?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/property_report_repair.py | 1 -
.../models/property_report_repair.py | 14 +++-
.../models/yuthon_task_approval.py | 38 +++++++++
yuthon_maintain/models/yuthon_task_setting.py | 19 +++++
yuthon_maintain/security/ir.model.access.csv | 2 +-
.../views/property_report_repair.xml | 11 +++
.../views/yuthon_task_approval_views.xml | 77 +++++++++++++++++++
.../views/yuthon_task_setting_views.xml | 34 ++++++++
yuthon_salary/wizard/salary_compute_wizard.py | 2 +-
9 files changed, 194 insertions(+), 4 deletions(-)
create mode 100644 yuthon_maintain/models/yuthon_task_approval.py
create mode 100644 yuthon_maintain/models/yuthon_task_setting.py
create mode 100644 yuthon_maintain/views/yuthon_task_approval_views.xml
create mode 100644 yuthon_maintain/views/yuthon_task_setting_views.xml
diff --git a/yuthon_lessee_service/models/property_report_repair.py b/yuthon_lessee_service/models/property_report_repair.py
index 6bc319153..27eb139d6 100644
--- a/yuthon_lessee_service/models/property_report_repair.py
+++ b/yuthon_lessee_service/models/property_report_repair.py
@@ -20,7 +20,6 @@ class PropertyRentRelief(models.Model):
situation = fields.Char(string="现场说明情况")
is_fee = fields.Boolean(string="是否产生费用")
labor_costs = fields.Float(string="人工费")
- device_name = fields.Char(string="设备名称")
confirmation_repairer = fields.Char(string="报修人确认")
warehouse_management = fields.Char(string="库管")
diff --git a/yuthon_maintain/models/property_report_repair.py b/yuthon_maintain/models/property_report_repair.py
index 1a5dabf62..e911080e5 100644
--- a/yuthon_maintain/models/property_report_repair.py
+++ b/yuthon_maintain/models/property_report_repair.py
@@ -27,6 +27,7 @@ class PropertyRentRelief(models.Model):
software_processing_id = fields.Many2one('software.issues.processing', string="处理类型")
hardware_processing_id = fields.Many2one('hardware.issues.processing', string="处理类型")
resolution = fields.Text(string="解决方法")
+ device_name = fields.Char(string="设备名称")
picture_resolution_id = fields.Many2one('ir.attachment', string="图片上传")
repair_company = fields.Char(string="维修人/公司")
list_quotations = fields.Many2one('ir.attachment', string="报价清单")
@@ -49,6 +50,7 @@ class PropertyRentRelief(models.Model):
default='normal')
active = fields.Boolean('Active', default=True, tracking=True)
work_end = fields.Boolean(string="结束")
+ device_ids = fields.One2many('property.device.line', 'report_id', string="关联设备信息明细")
def _get_default_name_title(self):
return self._description if self._description else self._name
@@ -60,4 +62,14 @@ class PropertyRentRelief(models.Model):
if self.users_id:
self.name = self.users_id.name
if self.users_id and self.fault:
- self.name = self.users_id.name + self.fault
\ No newline at end of file
+ self.name = self.users_id.name + self.fault
+
+class PropertyDeviceLine(models.Model):
+ _name = 'property.device.line'
+ _description = '设备信息'
+
+ report_id = fields.Many2one('property.report.repair', string="设备信息")
+ name = fields.Char(string="设备名称")
+ device_specs = fields.Char(string="规格")
+ mac = fields.Char(string="MAC")
+ ip = fields.Char(string="IP")
\ No newline at end of file
diff --git a/yuthon_maintain/models/yuthon_task_approval.py b/yuthon_maintain/models/yuthon_task_approval.py
new file mode 100644
index 000000000..7ba6fec9d
--- /dev/null
+++ b/yuthon_maintain/models/yuthon_task_approval.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, exceptions, _
+
+class YuthonTaskApproval(models.Model):
+ _name = 'yuthon.task.approval'
+ _description = '作业审批表'
+ _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+ name = fields.Char(string='标题')
+ code = fields.Char(string="报修编号",
+ default=lambda self: self.env['ir.sequence'].next_by_code('property_report_repair_code'))
+ users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
+ department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
+ text = fields.Text(string='正文')
+ document_ids = fields.Many2many('ir.attachment', string="附件")
+ start_time = fields.Date(string="申请时间")
+ employee_ids = fields.Many2many('hr.employee', string="作业人员")
+ task_id = fields.Many2one('yuthon.task.setting', string="作业项目")
+ stack_position_ids = fields.Many2many('yuthon.stack.position', string="作业堆位")
+ task_start_time = fields.Datetime(string="作业开始时间")
+ task_end_time = fields.Datetime(string="作业结束时间")
+ urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
+ default='normal')
+ active = fields.Boolean('Active', default=True, tracking=True)
+ work_end = fields.Boolean(string="结束")
+ duration = fields.Float(string="时长", store=True)
+ concentration = fields.Float(string="浓度")
+ warning_value = fields.Float(string="警戒值")
+ number = fields.Integer(string="数量")
+
+
+ def _get_default_name_title(self):
+ return self._description if self._description else self._name
+
+ name_title = fields.Char(default=_get_default_name_title)
\ No newline at end of file
diff --git a/yuthon_maintain/models/yuthon_task_setting.py b/yuthon_maintain/models/yuthon_task_setting.py
new file mode 100644
index 000000000..e941d72f9
--- /dev/null
+++ b/yuthon_maintain/models/yuthon_task_setting.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, exceptions, _
+
+class YuthonTaskSetting(models.Model):
+ _name = 'yuthon.task.setting'
+ _description = '作业项目配置'
+
+ name = fields.Char(string='名称', required=True)
+ standard = fields.Text(string='标准')
+ inspector = fields.Text(string='工作要求')
+ scope = fields.Char(string='发放范围')
+
+class YuthonStackPosition(models.Model):
+ _name = 'yuthon.stack.position'
+ _description = '堆垛位置'
+
+ name = fields.Char(string='名称', required=True)
\ No newline at end of file
diff --git a/yuthon_maintain/security/ir.model.access.csv b/yuthon_maintain/security/ir.model.access.csv
index db41bb703..17e2c1f82 100644
--- a/yuthon_maintain/security/ir.model.access.csv
+++ b/yuthon_maintain/security/ir.model.access.csv
@@ -8,4 +8,4 @@ access_maintain_service_setting,maintain_service_setting,model_maintain_service_
access_maintain_desktop_setting,maintain_desktop_setting,model_maintain_desktop_setting,base.group_user,1,1,1,1
access_yuthon_maintain_service,yuthon_maintain_service,model_yuthon_maintain_service,base.group_user,1,1,1,1
access_yuthon_maintain_desktop,yuthon_maintain_desktop,model_yuthon_maintain_desktop,base.group_user,1,1,1,1
-
+access_property_device_line,property_device_line,model_property_device_line,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_maintain/views/property_report_repair.xml b/yuthon_maintain/views/property_report_repair.xml
index 06377858b..4a93d10d8 100644
--- a/yuthon_maintain/views/property_report_repair.xml
+++ b/yuthon_maintain/views/property_report_repair.xml
@@ -53,6 +53,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_maintain/views/yuthon_task_approval_views.xml b/yuthon_maintain/views/yuthon_task_approval_views.xml
new file mode 100644
index 000000000..633bd32e7
--- /dev/null
+++ b/yuthon_maintain/views/yuthon_task_approval_views.xml
@@ -0,0 +1,77 @@
+
+
+
+ yuthon.task.approval.tree
+ yuthon.task.approval
+
+
+
+
+
+
+
+
+
+ yuthon.task.approval.form
+ yuthon.task.approval
+
+
+
+
+
+ 作业审批表
+ yuthon.task.approval
+ tree,form
+
+
diff --git a/yuthon_maintain/views/yuthon_task_setting_views.xml b/yuthon_maintain/views/yuthon_task_setting_views.xml
new file mode 100644
index 000000000..db228c1ec
--- /dev/null
+++ b/yuthon_maintain/views/yuthon_task_setting_views.xml
@@ -0,0 +1,34 @@
+
+
+
+ yuthon.task.setting.tree
+ yuthon.task.setting
+
+
+
+
+
+
+
+
+
+
+ 作业项目配置
+ yuthon.task.setting
+ tree,form
+
+
+ yuthon.stack.position.tree
+ yuthon.stack.position
+
+
+
+
+
+
+
+ 堆位配置
+ yuthon.stack.position
+ tree
+
+
\ No newline at end of file
diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py
index bb8f05468..e4176f9ae 100644
--- a/yuthon_salary/wizard/salary_compute_wizard.py
+++ b/yuthon_salary/wizard/salary_compute_wizard.py
@@ -13,7 +13,7 @@ class SalaryComputeWizard(models.Model):
_description = '薪资计算弹窗'
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
- string='公司')
+ string='公司', default=lambda self: self.env.user.employee_id.yuthon_company)
employee_ids = fields.Many2many('hr.employee', string='人员', store=True)
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='年份',
default=lambda self: str(datetime.now().year))