diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py
index 286fb72a4..58d250d28 100644
--- a/soong_workflow/models/soong_workflow_mixin.py
+++ b/soong_workflow/models/soong_workflow_mixin.py
@@ -277,7 +277,7 @@ class SoongWorkflowMixin(models.AbstractModel):
result_dict = {}
for node_to in i.out_link_ids.node_to:
result_dict[node_to.name] = (self.get_all_sub_departments(node_to.department_id) | node_to.department_id if node_to.department_id else False)
- matched_key = next((key for key, value in result_dict.items() if value and self.department_id in value),'校对')
+ matched_key = next((key for key, value in result_dict.items() if value and self.department_id in value),'部门经理')
self.env['trans.link'].create({
'node_button_id': btn_rec.id,
'name': matched_key,
diff --git a/yuthon_hr_employee_approval/models/yuthon_department_change.py b/yuthon_hr_employee_approval/models/yuthon_department_change.py
index e5383ad5e..1378595b5 100644
--- a/yuthon_hr_employee_approval/models/yuthon_department_change.py
+++ b/yuthon_hr_employee_approval/models/yuthon_department_change.py
@@ -1,3 +1,5 @@
+from email.policy import default
+
from odoo import models, fields, api
from odoo.exceptions import UserError
@@ -18,10 +20,12 @@ class YuthonDepartmentChange(models.Model):
reason_application = fields.Html(string="申请事由")
documents_ids = fields.Many2many('ir.attachment', string="附件")
active = fields.Boolean('Active', default=True)
+ is_department = fields.Boolean()
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
work_end = fields.Boolean(string="结束")
approval_ids = fields.One2many('department.change.approval.line', 'department_change_id', string="部门变更审批明细")
+ approval2_ids = fields.One2many('department.change.approval.line2', 'department_change_id', string="部门变更审批明细")
def _get_default_name_title(self):
return self._description if self._description else self._name
@@ -47,14 +51,30 @@ class YuthonDepartmentChange(models.Model):
for record in self:
for approval in record.approval_ids:
approval.department_id.write({'name': approval.new_name})
- approval.is_department = True
+ record.is_department = True
+
+ @api.onchange('approval_ids')
+ def _onchange_approval_ids(self):
+ self.approval2_ids = [(5, 0, 0)]
+ for record in self:
+ for approval in record.approval_ids:
+ self.approval2_ids = [(0, 0, {
+ 'name': approval.department_id.name,
+ 'new_name': approval.new_name,
+ })]
class DepartmentChangeApprovalLine(models.Model):
_name = 'department.change.approval.line'
_description = '部门变更审批明细'
department_change_id = fields.Many2one('yuthon.department.change', string='关联部门变更')
- is_department = fields.Boolean(string="字段隐藏")
department_id = fields.Many2one('hr.department', string='原部门名称')
- name = fields.Char(related='department_id.name', string='原部门名称')
+ new_name = fields.Char(string='新部门名称')
+
+class DepartmentChangeApprovalLine2(models.Model):
+ _name = 'department.change.approval.line2'
+ _description = '部门变更审批明细'
+
+ department_change_id = fields.Many2one('yuthon.department.change', string='关联部门变更')
+ name = fields.Char(string='原部门名称')
new_name = fields.Char(string='新部门名称')
\ No newline at end of file
diff --git a/yuthon_hr_employee_approval/security/ir.model.access.csv b/yuthon_hr_employee_approval/security/ir.model.access.csv
index d7eea8e7c..5f477a2af 100644
--- a/yuthon_hr_employee_approval/security/ir.model.access.csv
+++ b/yuthon_hr_employee_approval/security/ir.model.access.csv
@@ -50,3 +50,4 @@ access_yuthon_return_line,yuthon_return_line,model_yuthon_return_line,base.group
access_yuthon_goods_line,yuthon_goods_line,model_yuthon_goods_line,base.group_user,1,1,1,1
access_yuthon_department_change, yuthon_department_change,model_yuthon_department_change,base.group_user,1,1,1,1
access_department_change_approval_line,department_change_approval_line,model_department_change_approval_line,base.group_user,1,1,1,1
+access_department_change_approval_line2,department_change_approval_line2,model_department_change_approval_line2,base.group_user,1,1,1,1
diff --git a/yuthon_hr_employee_approval/views/yuthon_department_change_viwes.xml b/yuthon_hr_employee_approval/views/yuthon_department_change_viwes.xml
index 74c1a6e53..5313a4a6c 100644
--- a/yuthon_hr_employee_approval/views/yuthon_department_change_viwes.xml
+++ b/yuthon_hr_employee_approval/views/yuthon_department_change_viwes.xml
@@ -49,19 +49,27 @@
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index 7aae910d1..3d2857008 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -225,6 +225,25 @@ class YuthonProperty(models.Model):
}
}
+ def put_property_management(self):
+ property_ids = self.env["yuthon.property"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ form_id = self.env.ref('yuthon_property_approval.view_property_management_form').id
+ property_list = []
+ for record in property_ids:
+ property_list.append([0, 0, {'property_id': record.id}])
+ return {
+ 'name': '提交物业变更',
+ 'view_mode': 'form',
+ 'res_model': 'property.management',
+ 'type': 'ir.actions.act_window',
+ 'views': [(form_id, 'form')],
+ "context": {
+ 'default_management_line2_ids': property_list
+ }
+ }
+
+
def put_assessment_approval(self):
for record in self:
self.env['property.evaluation.plan'].create({
diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml
index b2ca9928b..240fe6d56 100644
--- a/yuthon_property/views/yuthon_property_views.xml
+++ b/yuthon_property/views/yuthon_property_views.xml
@@ -10,6 +10,7 @@
+
diff --git a/yuthon_property_approval/models/property_information.py b/yuthon_property_approval/models/property_information.py
index cad520371..90ed411a7 100644
--- a/yuthon_property_approval/models/property_information.py
+++ b/yuthon_property_approval/models/property_information.py
@@ -14,16 +14,7 @@ class PropertyInformation(models.Model):
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_information_code'))
property_documents_ids = fields.Many2many('documents.document', string="物业信息文件")
-
- purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
- original_property_id = fields.Many2one('property.management', string="关联物业管理变更审批")
- property_name = fields.Char(string="物业名称")
- company_id = fields.Many2one('res.company', string="公司")
- admin_id = fields.Many2one('res.users', string="管理员")
- precinct = fields.Char(string="片区")
address = fields.Text(string="物业地址")
- tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
- property_id = fields.Char(string="物业ID")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
active = fields.Boolean('Active', default=True, tracking=True)
diff --git a/yuthon_property_approval/models/property_management.py b/yuthon_property_approval/models/property_management.py
index 8dce9fafb..f4b22f4d6 100644
--- a/yuthon_property_approval/models/property_management.py
+++ b/yuthon_property_approval/models/property_management.py
@@ -14,12 +14,16 @@ class PropertyManagement(models.Model):
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_management_code'))
reason_change = fields.Char(string="变更事由")
+ user_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user)
+ department_id = fields.Many2one('hr.department', related='user_id.employee_id.department_id',string="申请人部门")
handling_opinions = fields.Text(string="经办意见")
- original_property_ids = fields.One2many('property.information', 'original_property_id', string="原物业信息")
+ management_line2_ids = fields.One2many('property.management.line2', 'property_management_id', string="原物业信息")
new_property_ids = fields.One2many('property.information.detail.lines', 'new_property_id', string="新物业信息")
+ management_line_ids = fields.One2many('property.management.line', 'property_management_id', string="物业信息")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
is_issues = fields.Boolean(string='是否上会')
+ is_line = fields.Boolean(string='明细行隐藏')
issues_result = fields.Html(string="会议结果")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
active = fields.Boolean('Active', default=True, tracking=True)
@@ -46,17 +50,72 @@ class PropertyManagement(models.Model):
'approval_date': fields.Datetime.now(),
})
+ @api.onchange('management_line2_ids')
+ def _onchange_management_line2_ids(self):
+ self.management_line_ids = [(5, 0, 0)]
+ self.new_property_ids = [(5, 0, 0)]
+ for line in self.management_line2_ids:
+ if line.property_id:
+ self.management_line_ids = [(0, 0, {
+ 'property_id': line.property_id.id,
+ 'company_id': line.company_id.id,
+ 'purpose_id': line.purpose_id.id,
+ 'precinct_id': line.precinct_id.id,
+ 'admin_id_all': line.admin_id_all.id,
+ 'tenure_type': line.tenure_type
+ })]
+ self.new_property_ids = [(0, 0, {
+ 'property_id': line.property_id.id,
+ })]
+
+ def approval_end(self):
+ for record in self:
+ for line in record.new_property_ids:
+ line.property_id.write({
+ 'company_id': line.company_id.id,
+ 'purpose_id': line.purpose_id.id,
+ 'precinct_id': line.precincts_id.id,
+ 'admin_id': line.admin_id_all.id,
+ 'tenure_type': line.tenure_type
+ })
+ record.write({'is_line': True})
class PropertyInformationDetailLines(models.Model):
_name = 'property.information.detail.lines'
_description = '新物业信息'
- new_property_id = fields.Many2one('property.management', string="新物业信息")
+ new_property_id = fields.Many2one('property.management', string="关联物业分配申请表")
+ property_id = fields.Many2one('yuthon.property', string="物业名称")
company_id = fields.Many2one('yuthon.property.company', string="公司")
purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
- admin_id = fields.Many2one('res.users', string="管理员")
- new_precincts = fields.Many2one('yuthon.precinct.message', string="新片区")
+ admin_id_all = fields.Many2one('res.users', string="管理员")
+ precincts_id = fields.Many2one('yuthon.precinct.message', string="新片区")
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
+# 结果保留明细行
+class PropertyManagementLine(models.Model):
+ _name = 'property.management.line'
+ _description = '物业信息'
+
+ property_id = fields.Many2one('yuthon.property', string="物业名称")
+ property_management_id = fields.Many2one('property.management', string="关联物业分配申请表")
+ company_id = fields.Many2one('yuthon.property.company', string="公司")
+ purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
+ admin_id_all = fields.Many2one('res.users', string="管理员")
+ precinct_id = fields.Many2one('yuthon.precinct.message', string="所属片区")
+ tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
+
+# 初始明细行
+class PropertyManagementLine2(models.Model):
+ _name = 'property.management.line2'
+ _description = '物业信息'
+
+ property_management_id = fields.Many2one('property.management', string="关联物业分配申请表")
+ property_id = fields.Many2one('yuthon.property', string="物业名称")
+ purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
+ tenure_type = fields.Selection(related='property_id.tenure_type', string='权属类型')
+ company_id = fields.Many2one(related='property_id.company_id', string="公司")
+ admin_id_all = fields.Many2one(related='property_id.admin_id', string="管理员")
+ precinct_id = fields.Many2one(related='property_id.precinct_id', string="所属片区")
diff --git a/yuthon_property_approval/security/ir.model.access.csv b/yuthon_property_approval/security/ir.model.access.csv
index 1cd287127..a1efa2d8c 100644
--- a/yuthon_property_approval/security/ir.model.access.csv
+++ b/yuthon_property_approval/security/ir.model.access.csv
@@ -95,5 +95,7 @@ access_property_tenant_line, property_tenant_line,model_property_tenant_line,bas
access_property_meeting_approval,property_meeting_approval,model_property_meeting_approval,base.group_user,1,1,1,1
access_property_meeting_wizard,property_meeting_wizard,model_property_meeting_wizard,base.group_user,1,1,1,1
access_property_meeting_line,property_meeting_line,model_property_meeting_line,base.group_user,1,1,1,1
+access_property_management_line, property_management_line,model_property_management_line,base.group_user,1,1,1,1
+access_property_management_line2, property_management_line2,model_property_management_line2,base.group_user,1,1,1,1
diff --git a/yuthon_property_approval/views/property_management.xml b/yuthon_property_approval/views/property_management.xml
index 3b629eaa0..1fd37c7e2 100644
--- a/yuthon_property_approval/views/property_management.xml
+++ b/yuthon_property_approval/views/property_management.xml
@@ -16,6 +16,9 @@
property.management