From c06b9b45944a5acc838e41061ad5c904b528e079 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: Wed, 17 Jun 2026 16:35:02 +0800 Subject: [PATCH 1/2] =?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 --- soong_workflow/wizard/soong_workflow_comment_wizard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index e8f0b5e77..fd511b9e8 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -802,6 +802,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): [('user_id', '=', record_id.log_ids[0].done_by.id)], limit=1) if workflow_record: workflow_record.write({ + 'approve_state': 'end', 'employee_ids': [(6, 0, [employee_id.id])], 'soong_state': 'to_active', 'node_id': False, @@ -830,8 +831,10 @@ class SoongWorkflowCommentWizard(models.TransientModel): 'employee_ids': False, }) else: - if workflow_record: + if workflow_record and self.node_btn_name == '结束': workflow_record.sudo().write({ + 'approve_state': 'end', + 'employee_ids': False, 'node_id': False, 'soong_state': 'done', }) From 245672de6c855a1fe4bd1204a9500f4b4f0f8cb9 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: Wed, 17 Jun 2026 17:02:15 +0800 Subject: [PATCH 2/2] =?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_trade/__manifest__.py | 3 + yuthon_trade/data/sale_renting_code_data.xml | 7 ++ yuthon_trade/models/__init__.py | 1 + .../models/yuthon_union_business_approval.py | 75 ++++++++++++++++++ yuthon_trade/security/ir.model.access.csv | 1 + .../yuthon_union_business_approval_views.xml | 76 +++++++++++++++++++ 6 files changed, 163 insertions(+) create mode 100644 yuthon_trade/models/yuthon_union_business_approval.py create mode 100644 yuthon_trade/views/yuthon_union_business_approval_views.xml diff --git a/yuthon_trade/__manifest__.py b/yuthon_trade/__manifest__.py index 07f826477..39d08f10c 100644 --- a/yuthon_trade/__manifest__.py +++ b/yuthon_trade/__manifest__.py @@ -24,6 +24,7 @@ 'views/yuthon_trade_purchase.xml', 'views/yuthon_trade_premium.xml', 'views/yuthon_business_approval_viwes.xml', + 'views/yuthon_union_business_approval_views.xml', 'views/yuthon_seals_approval_views.xml', 'views/yuthon_trade_refund.xml', 'views/yuthon_trade_reimbursed.xml', @@ -44,6 +45,8 @@ 'views/yuthon_trade_menu.xml', 'report/business_approval_print_report.xml', 'report/business_approval_print_templates.xml', + 'report/union_business_approval_print_report.xml', + 'report/union_business_approval_print_templates.xml', ], 'demo': [], 'depends': ['mail', 'documents', 'soong_workflow', 'hr', 'yuthon_hr_employee', 'yuthon_issue', 'project'], diff --git a/yuthon_trade/data/sale_renting_code_data.xml b/yuthon_trade/data/sale_renting_code_data.xml index 283232bb4..3bf88f904 100644 --- a/yuthon_trade/data/sale_renting_code_data.xml +++ b/yuthon_trade/data/sale_renting_code_data.xml @@ -28,6 +28,13 @@ 3 + + 业务审批编号(工会) + yuthon_union_business_approval_code + GHW%(y)s%(month)s%(day)s + 3 + + 移交社会化审批编号 yuthon_social_transfer_code diff --git a/yuthon_trade/models/__init__.py b/yuthon_trade/models/__init__.py index 4b7a3b1c2..e423aceb4 100644 --- a/yuthon_trade/models/__init__.py +++ b/yuthon_trade/models/__init__.py @@ -22,6 +22,7 @@ from . import yuthon_task_setting from . import trade_reward_approval from . import yuthon_seals_approval from . import yuthon_business_approval +from . import yuthon_union_business_approval from . import inherit_workflow_record from . import trade_project_approval from . import parking_fee_approval diff --git a/yuthon_trade/models/yuthon_union_business_approval.py b/yuthon_trade/models/yuthon_union_business_approval.py new file mode 100644 index 000000000..ae0de8d10 --- /dev/null +++ b/yuthon_trade/models/yuthon_union_business_approval.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api + + +class YuthonUnionBusinessApproval(models.Model): + _name = 'yuthon.union.business.approval' + _description = '业务审批(工会)' + _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] + + name = fields.Char(string='标题') + code = fields.Char(string="流水号", + default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_union_business_approval_code')) + users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) + urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', + default='normal') + department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") + is_issues = fields.Boolean(string='是否上会') + issues_result = fields.Html(string="会议结果") + related_issues_id = fields.Many2one('issue.library', string="关联议题") + information_categories_ids = fields.Many2many( + 'yuthon.information.categories', + relation='yuthon_union_biz_approval_info_cat_rel', + column1='approval_id', + column2='category_id', + string='类型', + ) + reason = fields.Text(string="正文") + document_ids = fields.Many2many( + 'ir.attachment', + relation='yuthon_union_biz_approval_attachment_rel', + column1='approval_id', + column2='attachment_id', + string="附件", + ) + is_chapter = fields.Selection([('yes', '是'), ('no', '否')], string="是否用章") + type_stamp_ids = fields.Many2many('seals.type.setting', string='用章类型') + scope_chapter_ids = fields.Many2many('seals.scope.setting', string='用章范围') + active = fields.Boolean('Active', default=True, tracking=True) + work_end = fields.Boolean(string="结束") + receivable_amount = fields.Float(string="应收") + payable_amount = fields.Float(string="应付") + is_finance_business = fields.Boolean(string="是否经营业务(财务专用)", compute='_compute_is_finance_business', store=False) + + @api.depends('information_categories_ids') + def _compute_is_finance_business(self): + for record in self: + record.is_finance_business = any( + cat.name == '经营业务(财务专用)' for cat in record.information_categories_ids + ) + + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) + self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])]) + + @api.onchange('is_issues') + def _onchange_is_issues(self): + if self.is_issues: + issue_id = self.env['issue.library'].create({'name': self.name, 'is_invisible_workflow': True}) + self.related_issues_id = issue_id.id + self.env['issue.library.approval.line'].create({ + 'issue_library_id': issue_id.id, + 'workflow_name': self.name, + 'approval_type': self.workflow_id.name, + 'res_model': self._name, + 'res_id': self.id, + 'code': self.code, + 'approval_date': fields.Datetime.now(), + }) + + def action_print_union_business_approval(self): + """打印业务审批单(工会)""" + report_ref = self.env.ref('yuthon_trade.action_union_business_approval_print_report') + return report_ref.report_action(self) diff --git a/yuthon_trade/security/ir.model.access.csv b/yuthon_trade/security/ir.model.access.csv index 73e0ef97e..a4d3bb0a9 100644 --- a/yuthon_trade/security/ir.model.access.csv +++ b/yuthon_trade/security/ir.model.access.csv @@ -14,6 +14,7 @@ access_yuthon_care_condolences,yuthon_care_condolences,model_yuthon_care_condole access_yuthon_work_condolences,yuthon_work_condolences,model_yuthon_work_condolences,base.group_user,1,1,1,1 access_yuthon_seals_approval,yuthon_seals_approval,model_yuthon_seals_approval,base.group_user,1,1,1,1 access_yuthon_business_approval,yuthon_business_approval,model_yuthon_business_approval,base.group_user,1,1,1,1 +access_yuthon_union_business_approval,yuthon_union_business_approval,model_yuthon_union_business_approval,base.group_user,1,1,1,1 access_yuthon_care_setting,yuthon_care_setting,model_yuthon_care_setting,base.group_user,1,1,1,1 access_yuthon_work_setting,yuthon_work_setting,model_yuthon_work_setting,base.group_user,1,1,1,1 diff --git a/yuthon_trade/views/yuthon_union_business_approval_views.xml b/yuthon_trade/views/yuthon_union_business_approval_views.xml new file mode 100644 index 000000000..66f0cf057 --- /dev/null +++ b/yuthon_trade/views/yuthon_union_business_approval_views.xml @@ -0,0 +1,76 @@ + + + + yuthon.union.business.approval.tree + yuthon.union.business.approval + + + + + + + + + yuthon.union.business.approval.form + yuthon.union.business.approval + +
+
+
+ + + + + + + + + +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + 业务审批(工会) + yuthon.union.business.approval + tree,form + +