diff --git a/yuthon_maintain/models/processing_order_approval.py b/yuthon_maintain/models/processing_order_approval.py index 1a425d4f1..33de5f59c 100644 --- a/yuthon_maintain/models/processing_order_approval.py +++ b/yuthon_maintain/models/processing_order_approval.py @@ -16,7 +16,8 @@ class ProcessingOrderApproval(models.Model): display_name = fields.Char(string='名称', compute='_compute_name',) code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('processing_order_approval_code')) - applicant_id = fields.Many2one('res.users', string="申请人") + applicant_id = fields.Many2one('res.users', string="报修人") + repair_date = fields.Date(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="部门") company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司") diff --git a/yuthon_maintain/models/property_device_repair.py b/yuthon_maintain/models/property_device_repair.py index 13a3c17d6..951e84e2e 100644 --- a/yuthon_maintain/models/property_device_repair.py +++ b/yuthon_maintain/models/property_device_repair.py @@ -38,15 +38,19 @@ 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.name = f" {rec.software_processing_id.name}-{rec.users_id.name}-{rec.remake}" + def get_no_read_count(self): + return self.search_count([('report_state', '=', 'to')]) + def pull_order(self): soong_workflow_line_list = [] if self.env['processing.order.approval'].search([('device_id', '=', self.id)]): raise UserError('该设备已生成处理单') order_id = self.env['processing.order.approval'].create({ 'device_id': self.id, + 'repair_date': self.create_time, 'applicant_id': self.users_id.id, 'name': self.problem_description, 'code': self.env['ir.sequence'].next_by_code('property_device_repair_code'), diff --git a/yuthon_maintain/models/property_report_repair.py b/yuthon_maintain/models/property_report_repair.py index 8cec20bbe..f058dafd0 100644 --- a/yuthon_maintain/models/property_report_repair.py +++ b/yuthon_maintain/models/property_report_repair.py @@ -70,6 +70,7 @@ class PropertyRentRelief(models.Model): raise UserError('该设备已生成处理单') order_id = self.env['processing.order.approval'].create({ 'repair_id': self.id, + 'repair_date': self.create_time, 'applicant_id': self.users_id.id, 'name': self.problem_description, 'problem_description': self.problem_description, diff --git a/yuthon_maintain/views/processing_order_approval_views.xml b/yuthon_maintain/views/processing_order_approval_views.xml index a2a1c4e9a..286816ce0 100644 --- a/yuthon_maintain/views/processing_order_approval_views.xml +++ b/yuthon_maintain/views/processing_order_approval_views.xml @@ -45,6 +45,8 @@ + + diff --git a/yuthon_purchase/__manifest__.py b/yuthon_purchase/__manifest__.py index 09b987d3a..210bead75 100644 --- a/yuthon_purchase/__manifest__.py +++ b/yuthon_purchase/__manifest__.py @@ -10,6 +10,7 @@ 'data': [ 'security/ir.model.access.csv', 'security/company_rule.xml', + 'data/process_code_data.xml', 'report/purchase_workflow_report.xml', 'report/purchase_workflow_templates.xml', 'views/inherit_product_product_views.xml',