From ab45b8a51526fb1422aa83827e440979c3371bb2 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sun, 19 Jan 2025 16:59:45 +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 --- yuthon_maintain/__manifest__.py | 4 + yuthon_maintain/models/__init__.py | 4 +- .../models/lessee_service_setting.py | 46 +++++++++ .../models/property_report_repair.py | 58 ++++++++++++ .../models/yuthon_maintain_desktop.py | 24 +++++ .../models/yuthon_maintain_service.py | 19 ++++ yuthon_maintain/security/ir.model.access.csv | 7 ++ yuthon_maintain/views/all_menu.xml | 59 ++++++++++++ .../views/lessee_service_setting_views.xml | 86 +++++++++++++++++ .../views/property_report_repair.xml | 94 +++++++++++++++++++ .../views/yuthon_maintain_desktop_views.xml | 59 ++++++++++++ .../views/yuthon_maintain_service_views.xml | 51 ++++++++++ .../models/yuthon_care_condolences.py | 2 +- .../models/yuthon_work_condolences.py | 2 +- .../views/yuthon_care_condolences_views.xml | 50 +++++----- .../views/yuthon_work_condolences_views.xml | 32 +++---- 16 files changed, 547 insertions(+), 50 deletions(-) create mode 100644 yuthon_maintain/models/lessee_service_setting.py create mode 100644 yuthon_maintain/models/property_report_repair.py create mode 100644 yuthon_maintain/models/yuthon_maintain_desktop.py create mode 100644 yuthon_maintain/models/yuthon_maintain_service.py create mode 100644 yuthon_maintain/views/all_menu.xml create mode 100644 yuthon_maintain/views/lessee_service_setting_views.xml create mode 100644 yuthon_maintain/views/property_report_repair.xml create mode 100644 yuthon_maintain/views/yuthon_maintain_desktop_views.xml create mode 100644 yuthon_maintain/views/yuthon_maintain_service_views.xml diff --git a/yuthon_maintain/__manifest__.py b/yuthon_maintain/__manifest__.py index 570a44b82..a6fb88d82 100644 --- a/yuthon_maintain/__manifest__.py +++ b/yuthon_maintain/__manifest__.py @@ -13,7 +13,11 @@ 'depends': ['documents'], 'data': [ 'security/ir.model.access.csv', + 'views/lessee_service_setting_views.xml', + 'views/property_report_repair.xml', + 'views/yuthon_maintain_service_views.xml', 'views/maintenance_equipment_views.xml', + 'views/all_menu.xml', ], 'installable': True, 'application': True, diff --git a/yuthon_maintain/models/__init__.py b/yuthon_maintain/models/__init__.py index 2d9a5c23a..61e410f2c 100644 --- a/yuthon_maintain/models/__init__.py +++ b/yuthon_maintain/models/__init__.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- - from . import inherit_maintenance_equipment +from . import lessee_service_setting +from . import property_report_repair +from . import yuthon_maintain_service diff --git a/yuthon_maintain/models/lessee_service_setting.py b/yuthon_maintain/models/lessee_service_setting.py new file mode 100644 index 000000000..ec07b3a50 --- /dev/null +++ b/yuthon_maintain/models/lessee_service_setting.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ + + +class SoftwareIssuesSetting(models.Model): + _name = 'software.issues.setting' + _description = '软件问题' + + name = fields.Char(string='软件问题') + + +class HardwareIssuesSetting(models.Model): + _name = 'hardware.issues.setting' + _description = '硬件问题' + + name = fields.Char(string='硬件问题') + + +class SoftwareIssuesProcessing(models.Model): + _name = 'software.issues.processing' + _description = '软件处理类型' + + name = fields.Char(string='软件处理方式') + + +class HardwareIssuesProcessing(models.Model): + _name = 'hardware.issues.processing' + _description = '硬件处理类型' + + name = fields.Char(string='硬件处理方式') + + +class MaintainServiceSetting(models.Model): + _name = 'maintain.service.setting' + _description = '服务器类型' + + name = fields.Char(string='服务器类型') + + +class MaintainDesktopSetting(models.Model): + _name = 'maintain.desktop.setting' + _description = '桌面类型' + + name = fields.Char(string='桌面类型') diff --git a/yuthon_maintain/models/property_report_repair.py b/yuthon_maintain/models/property_report_repair.py new file mode 100644 index 000000000..7e6ebc77a --- /dev/null +++ b/yuthon_maintain/models/property_report_repair.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ + +class PropertyRentRelief(models.Model): + _name = 'property.report.repair' + _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) + repairer_date = fields.Date(string="报修时间") + department_id = fields.Many2one(related='users_id.employee_id.department_id', string="报修部门") + repairer_address = fields.Char(string="报修人地址") + fault = fields.Text(string="故障信息") + + dispatch_date = fields.Date(string="派单时间") + dispatch_head_id = fields.Many2one('hr.employee', string="派单人负责人") + team_ids = fields.Many2many('hr.employee', string="维修团队") + completion_time = fields.Datetime(string="预计完成时间") + dispatch_notes = fields.Text(string="派单备注") + + urgency = fields.Selection([('low', '低'), ('middle', '中'), ('high', '高')], string="紧急程度") + possible_causes = fields.Selection([('software', '软件问题'), ('hardware', '硬件问题')], string="可能原因") + software_id = fields.Many2one('software.issues.setting', string="具体软件问题") + hardware_id = fields.Many2one('hardware.issues.setting', string="具体硬件问题") + specific_reasons = fields.Text(string="具体原因") + software_processing_id = fields.Many2one('software.issues.processing', string="处理类型") + hardware_processing_id = fields.Many2one('hardware.issues.processing', string="处理类型") + resolution = fields.Text(string="解决方法") + documents_ids = fields.Many2many('ir.attachment', string="附件") + fees = fields.Float(string="费用") + repair_company = fields.Char(string="维修人/公司") + list_quotations = fields.Many2one('ir.attachment', string="报价清单") + invoice_id = fields.Many2one('ir.attachment', string="发票附件") + + hardware_parts = fields.Char(string="更换部件") + hardware_fee = fields.Float(string="部件费用") + + software_parts = fields.Char(string="软件名称/版本") + software_fee = fields.Float(string="软件费用") + + duration_service = fields.Float(string="服务时长") + service_fee = fields.Float(string="服务费") + service_fee_total = fields.Float(string="总费用") + service_fee_remark = fields.Text(string="费用备注") + situation = fields.Char(string="现场说明情况") + is_fee = fields.Boolean(string="是否产生费用") + labor_costs = fields.Float(string="人工费") + confirmation_repairer = fields.Char(string="报修人确认") + warehouse_management = fields.Char(string="库管") + total = fields.Float(string="总价") + + remake = fields.Text(string="备注") diff --git a/yuthon_maintain/models/yuthon_maintain_desktop.py b/yuthon_maintain/models/yuthon_maintain_desktop.py new file mode 100644 index 000000000..9bfc687ab --- /dev/null +++ b/yuthon_maintain/models/yuthon_maintain_desktop.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ + + +class YuthonMaintainDesktop(models.Model): + _name = 'yuthon.maintain.desktop' + _description = '桌面设置' + + name = fields.Char(string='名称') + desktop_id = fields.Many2one('maintain.desktop.setting', string='类型') + mac_address = fields.Char(string='MAC地址') + ip_address = fields.Char(string='IP地址') + cpu = fields.Char(string='CPU') + memory = fields.Char(string='内存') + hard_disk = fields.Char(string='硬盘') + account = fields.Char(string='账号') + password = fields.Char(string='密码') + desktop_type = fields.Char(string='类型') + purchase_date = fields.Date(string='购买日期') + users_id = fields.Many2one('res.users', string='使用人') + remake = fields.Text(string='备注日志') + qr_Image = fields.Image(string='二维码') diff --git a/yuthon_maintain/models/yuthon_maintain_service.py b/yuthon_maintain/models/yuthon_maintain_service.py new file mode 100644 index 000000000..240262f37 --- /dev/null +++ b/yuthon_maintain/models/yuthon_maintain_service.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 YuthonMaintainService(models.Model): + _name = 'yuthon.maintain.service' + _description = '服务器类' + + name = fields.Char(string='名称', required=True) + service_type_id = fields.Many2one('maintain.service.setting', string='服务器类型') + mac_address = fields.Char(string='MAC地址') + ip_address = fields.Char(string='IP地址') + time_purchase = fields.Date(string='购买时间') + service_state = fields.Char(string='状态') + remake = fields.Text(string='备注日志') + updated = fields.Datetime(string='更新时间') + qr_Image = fields.Image(string='二维码') \ 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 08145a00f..f7c6c012a 100644 --- a/yuthon_maintain/security/ir.model.access.csv +++ b/yuthon_maintain/security/ir.model.access.csv @@ -1,2 +1,9 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_property_report_repair,property_report_repair,model_property_report_repair,base.group_user,1,1,1,1 +access_software_issues_setting,software_issues_setting,model_software_issues_setting,base.group_user,1,1,1,1 +access_hardware_issues_setting,hardware_issues_setting,model_hardware_issues_setting,base.group_user,1,1,1,1 +access_software_issues_processing,software_issues_processing,model_software_issues_processing,base.group_user,1,1,1,1 +access_hardware_issues_processing,hardware_issues_processing,model_hardware_issues_processing,base.group_user,1,1,1,1 +access_maintain_service_setting,maintain_service_setting,model_maintain_service_setting,base.group_user,1,1,1,1 +access_maintain_desktop_setting,maintain_desktop_setting,model_maintain_desktop_setting,base.group_user,1,1,1,1 diff --git a/yuthon_maintain/views/all_menu.xml b/yuthon_maintain/views/all_menu.xml new file mode 100644 index 000000000..20bb13580 --- /dev/null +++ b/yuthon_maintain/views/all_menu.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yuthon_maintain/views/lessee_service_setting_views.xml b/yuthon_maintain/views/lessee_service_setting_views.xml new file mode 100644 index 000000000..53fed75a4 --- /dev/null +++ b/yuthon_maintain/views/lessee_service_setting_views.xml @@ -0,0 +1,86 @@ + + + software issues setting + software.issues.setting + + + + + + + + 软件问题 + software.issues.setting + tree + + + hardware issues setting + hardware.issues.setting + + + + + + + + 硬件问题 + hardware.issues.setting + tree + + + software issues processing + software.issues.processing + + + + + + + + 软件处理类型 + software.issues.processing + tree + + + hardware issues processing + hardware.issues.processing + + + + + + + + 硬件处理类型 + hardware.issues.processing + tree + + + maintain.desktop.setting + maintain.desktop.setting + + + + + + + + 桌面类型设置 + _setting + tree + + + maintain.service.setting + maintain.service.setting + + + + + + + + 服务类型设置 + maintain.service.setting + tree + + diff --git a/yuthon_maintain/views/property_report_repair.xml b/yuthon_maintain/views/property_report_repair.xml new file mode 100644 index 000000000..ac9452b19 --- /dev/null +++ b/yuthon_maintain/views/property_report_repair.xml @@ -0,0 +1,94 @@ + + + + property.report.repair.tree + property.report.repair + + + + + + + + + property.report.repair.form + property.report.repair + +
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + 报事报修审批 + property.report.repair + tree,form + +
\ No newline at end of file diff --git a/yuthon_maintain/views/yuthon_maintain_desktop_views.xml b/yuthon_maintain/views/yuthon_maintain_desktop_views.xml new file mode 100644 index 000000000..64dff6082 --- /dev/null +++ b/yuthon_maintain/views/yuthon_maintain_desktop_views.xml @@ -0,0 +1,59 @@ + + + yuthon.maintain.desktop.tree + yuthon.maintain.desktop + + + + + + + + + + + + yuthon.maintain.desktop.form + yuthon.maintain.desktop + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + 桌面 + yuthon.maintain.desktop + tree,form + +
+ + diff --git a/yuthon_maintain/views/yuthon_maintain_service_views.xml b/yuthon_maintain/views/yuthon_maintain_service_views.xml new file mode 100644 index 000000000..1b9dfe8c8 --- /dev/null +++ b/yuthon_maintain/views/yuthon_maintain_service_views.xml @@ -0,0 +1,51 @@ + + + yuthon.maintain.service.tree + yuthon.maintain.service + + + + + + + + + 、 + + + yuthon.maintain.service.form + yuthon.maintain.service + +
+ +
+
+ + + + + + + + + + + + + + + +
+
+
+
+ + 服务器类 + yuthon.maintain.service + tree,form + +
\ No newline at end of file diff --git a/yuthon_trade/models/yuthon_care_condolences.py b/yuthon_trade/models/yuthon_care_condolences.py index e688e2eef..ec610528b 100644 --- a/yuthon_trade/models/yuthon_care_condolences.py +++ b/yuthon_trade/models/yuthon_care_condolences.py @@ -6,7 +6,7 @@ class YuthonCareCondolences(models.Model): _description = '关怀慰问' _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] - name = fields.Char(string='名称') + name = fields.Char(string='标题') 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="部门") care_type_id = fields.Many2one('yuthon.care.setting', string='类型') diff --git a/yuthon_trade/models/yuthon_work_condolences.py b/yuthon_trade/models/yuthon_work_condolences.py index 9e478d6a0..34442e0e4 100644 --- a/yuthon_trade/models/yuthon_work_condolences.py +++ b/yuthon_trade/models/yuthon_work_condolences.py @@ -6,7 +6,7 @@ class YuthonWorkCondolences(models.Model): _description = '关怀慰问' _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] - name = fields.Char(string='名称') + name = fields.Char(string='标题') 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="部门") work_type_id = fields.Many2one('yuthon.work.setting', string='类型') diff --git a/yuthon_trade/views/yuthon_care_condolences_views.xml b/yuthon_trade/views/yuthon_care_condolences_views.xml index cd9544d13..4d0ea1d26 100644 --- a/yuthon_trade/views/yuthon_care_condolences_views.xml +++ b/yuthon_trade/views/yuthon_care_condolences_views.xml @@ -20,36 +20,30 @@ -
-
- - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + diff --git a/yuthon_trade/views/yuthon_work_condolences_views.xml b/yuthon_trade/views/yuthon_work_condolences_views.xml index 7c95afead..141a90100 100644 --- a/yuthon_trade/views/yuthon_work_condolences_views.xml +++ b/yuthon_trade/views/yuthon_work_condolences_views.xml @@ -20,25 +20,19 @@ -
-
- - - - - - - - - - - - - + + + + + + + + + + + + +