From cf0ee11c2591fd4af0d882167dc74526fcdc8233 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 11 Jun 2025 19:28:22 +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 --- room/models/room_booking.py | 6 ++-- room/views/room_booking_views.xml | 4 +-- soong_workflow/models/soong_workflow_log.py | 2 +- soong_workflow/models/soong_workflow_mixin.py | 2 +- .../wizard/soong_workflow_comment_wizard.py | 22 ++++++------ yuthon_notice/models/yuthon_notice.py | 3 +- yuthon_notice/views/yuthon_notice_views.xml | 16 ++++++--- yuthon_salary/wizard/payslip_send_wizard.py | 36 +++++++++---------- .../wizard/payslip_send_wizard_views.xml | 1 + yuthon_will_task/models/yuthon_will_task.py | 2 +- .../views/yuthon_will_task_views.xml | 2 +- 11 files changed, 53 insertions(+), 43 deletions(-) diff --git a/room/models/room_booking.py b/room/models/room_booking.py index c987fb510..7db1cd7ce 100644 --- a/room/models/room_booking.py +++ b/room/models/room_booking.py @@ -35,10 +35,10 @@ class RoomBooking(models.Model): meeting_type = fields.Selection([('up', '线上'), ('down', '线下'), ('exterior', '外部')], default='down', string="会议形式", required=True) meeting_type_id = fields.Many2one('room.meeting.type', string="会议类型") - room_users_ids = fields.Many2many('res.users', string="出席人员") + room_users_ids = fields.Many2many('hr.employee', string="出席人员") room_users_names = fields.Char(string="出席人员char", compute="_compute_room_users", store=True) other_company_id = fields.Many2one('res.partner', string="外部公司") - host = fields.Many2one('res.users', string="主持人") + host = fields.Many2one('hr.employee', string="主持人") stationed_group = fields.Boolean(string="驻组参会") other_company_user_ids = fields.Many2many('other.meet.employee', string="其他人员") fleet_id = fields.Many2one('fleet.vehicle', string="车辆") @@ -52,7 +52,7 @@ class RoomBooking(models.Model): right_user = fields.Integer(string="实到") driver = fields.Many2one('hr.employee', string="司机") partner_ids = fields.Many2many('res.partner', string="日程安排人员") - is_this_company = fields.Boolean(string='是否为本公司', default=True) + is_this_company = fields.Boolean(string='本公司', default=True) # 关联流程 relevancy_type = fields.Selection([('none', '无')], string="关联流程类型") diff --git a/room/views/room_booking_views.xml b/room/views/room_booking_views.xml index cc422026c..cf4e2cbb8 100644 --- a/room/views/room_booking_views.xml +++ b/room/views/room_booking_views.xml @@ -169,7 +169,7 @@ - + @@ -178,7 +178,7 @@ - + diff --git a/soong_workflow/models/soong_workflow_log.py b/soong_workflow/models/soong_workflow_log.py index 2f20a827f..52b6c9bde 100644 --- a/soong_workflow/models/soong_workflow_log.py +++ b/soong_workflow/models/soong_workflow_log.py @@ -20,7 +20,7 @@ class SoongWorkflowLog(models.Model): workflow_id = fields.Many2one(comodel_name="soong.workflow") node_id = fields.Many2one(comodel_name="soong.workflow.node") node_btn_id = fields.Many2one(comodel_name="soong.workflow.node.button", string="动作名称") - node_btn_name = fields.Selection([('0', ' '), ('1', '退回'), ('2', '加签')], string='节点功能', default='0') + node_btn_name = fields.Selection([('0', ' '), ('1', '退回'), ('2', '加签'), ('3', '串'), ('4', '并')], string='节点功能', default='0') done_by = fields.Many2one(comodel_name="res.users", string="审批人") lase_click_date = fields.Datetime(string="操作时间") approval_state = fields.Selection([('0', '待办'), ('1', '办理中'), ('2', '已办结'), ('3', '结束')], string='状态', default='0') diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 074914d2d..53b177898 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -178,7 +178,7 @@ class SoongWorkflowMixin(models.AbstractModel): "workflow_id": btn_rec.workflow_id.id, "node_btn_id": btn_rec.id, "done_by": self.env.uid, - "node_btn_name": "0", + "node_btn_name": "", "lase_click_date": fields.Datetime.now(), }) record_obj.write({"node_btn_id": btn_rec.id, "done_by": self.env.uid, "approval_state": "2"}) diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 0e4e5e699..f6a385873 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -130,7 +130,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): continue link_users_id = button.users_role_id link_users_group_ids = button.users_role_group_ids - # 获取六个布尔字段的值(假设只有一个为True) + # 获取六个布尔字段的值 is_automatic = button.is_automatic is_automatic_company = button.is_automatic_company is_automatic_group = button.is_automatic_group @@ -240,15 +240,17 @@ class SoongWorkflowCommentWizard(models.TransientModel): "lase_click_date": fields.Datetime.now()}) next_node_id = record_id.workflow_id.node_ids.search([('name', 'ilike', self.trans_link_id.name), ('workflow_id', '=', record_id.workflow_id.id)]) - self.sudo().env["soong.workflow.log"].create({ - "code": self.code, - "model": self.res_model, - "res_id": self.res_id, - "node_id": next_node_id.id, - "workflow_id": self.node_btn_id.workflow_id.id, - "done_by": self.employee_ids.user_id.id, - "node_btn_name": "0", - }) + for employee in self.employee_ids: + self.sudo().env["soong.workflow.log"].create({ + "code": self.code, + "model": self.res_model, + "res_id": self.res_id, + "node_id": next_node_id.id, + "workflow_id": self.node_btn_id.workflow_id.id, + "done_by":employee.user_id.id, + "" + "node_btn_name": "0", + }) workflow_record_id = self.env['soong.workflow.record'].search([('code', '=', record_id.code)]) workflow_record_id.users_ids = [(4, self.employee_ids.user_id.id)] workflow_record_id.employee_ids = self.employee_ids diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py index 533b8a73c..dbe26f328 100644 --- a/yuthon_notice/models/yuthon_notice.py +++ b/yuthon_notice/models/yuthon_notice.py @@ -16,6 +16,7 @@ class YuthonNotice(models.Model): name = fields.Char(string='标题') code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('notice_code')) users_id = fields.Many2one('res.users', string="发布人", default=lambda self: self.env.user) + company_id = fields.Many2one(related="users_id.employee_id.company_id", string="公司", store=True) department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") notice_type_id = fields.Many2one('yuthon.notice.type', string="类型") create_date1 = fields.Date(string="发布日期", default=fields.Date.today()) @@ -33,7 +34,7 @@ class YuthonNotice(models.Model): attn_notice = fields.Html(string="经办人意见") notice_text = fields.Html(string="正文") read_number = fields.Integer(string='阅读量', compute="_compute_read_number", store=True) - is_this_company = fields.Boolean(string='是否为本公司', default=True) + is_this_company = fields.Boolean(string='本公司', default=True) approval_user_id = fields.Many2one('res.users', string="审核人") approval_date = fields.Datetime(string="审核日期") is_sticky = fields.Boolean(string="是否置顶") diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml index 8236a19bb..294984f01 100644 --- a/yuthon_notice/views/yuthon_notice_views.xml +++ b/yuthon_notice/views/yuthon_notice_views.xml @@ -37,14 +37,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -59,6 +64,7 @@ + @@ -72,16 +78,16 @@ - + - + - + diff --git a/yuthon_salary/wizard/payslip_send_wizard.py b/yuthon_salary/wizard/payslip_send_wizard.py index b9a3c62e2..0bb5bb872 100644 --- a/yuthon_salary/wizard/payslip_send_wizard.py +++ b/yuthon_salary/wizard/payslip_send_wizard.py @@ -14,27 +14,27 @@ class PayslipSendWizard(models.Model): def button_send(self): self.ensure_one() - for employee_id in self.env['hr.employee'].search([('id', '=', self.employee_id.id)]): - if not employee_id.wecom_userid: - raise UserError("请同步{}的企业微信".format(employee_id.name)) - menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的薪资')]) - url = f'https://oa.thtzjt.com/web?login={employee_id.user_id.login}#id={self.id}&cids=2&action={menu_id.action.id}&model=hr.payslip&view_type=form&menu_id={menu_id.id}' - self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task', - user_id=employee_id.wecom_userid, - title="薪资确认", - url=url, btntxt="详细信息") + # for employee_id in self.env['hr.employee'].search([('id', '=', self.employee_id.id)]): + # if not employee_id.wecom_userid: + # raise UserError("请同步{}的企业微信".format(employee_id.name)) + # menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的薪资')]) + # url = f'https://oa.thtzjt.com/web?login={employee_id.user_id.login}#id={self.id}&cids=2&action={menu_id.action.id}&model=hr.payslip&view_type=form&menu_id={menu_id.id}' + # self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task', + # user_id=employee_id.wecom_userid, + # title="薪资确认", + # url=url, btntxt="详细信息") def button_all_send(self): self.ensure_one() - for employee_id in self.env['hr.employee'].search([('id', '=', self.employee_ids.ids)]): - if not employee_id.wecom_userid: - raise UserError("请同步{}的企业微信".format(employee_id.name)) - menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的薪资')]) - url = f'https://oa.thtzjt.com/web?login={employee_id.user_id.login}#id={self.id}&cids=2&action={menu_id.action.id}&model=hr.payslip&view_type=form&menu_id={menu_id.id}' - self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task', - user_id=employee_id.wecom_userid, - title="薪资确认", - url=url, btntxt="详细信息") + # for employee_id in self.env['hr.employee'].search([('id', '=', self.employee_ids.ids)]): + # if not employee_id.wecom_userid: + # raise UserError("请同步{}的企业微信".format(employee_id.name)) + # menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的薪资')]) + # url = f'https://oa.thtzjt.com/web?login={employee_id.user_id.login}#id={self.id}&cids=2&action={menu_id.action.id}&model=hr.payslip&view_type=form&menu_id={menu_id.id}' + # self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task', + # user_id=employee_id.wecom_userid, + # title="薪资确认", + # url=url, btntxt="详细信息") self.payslip_run_id.run_stage = 'issued' run_payslips = self.env["hr.payslip"].search([ ('payslip_run_id', '=', self.payslip_run_id.id) diff --git a/yuthon_salary/wizard/payslip_send_wizard_views.xml b/yuthon_salary/wizard/payslip_send_wizard_views.xml index 534303f96..d0da90862 100644 --- a/yuthon_salary/wizard/payslip_send_wizard_views.xml +++ b/yuthon_salary/wizard/payslip_send_wizard_views.xml @@ -5,6 +5,7 @@ payslip.send.wizard
+
确定要推送吗?
diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index 6bce6e7ed..5d9f2452d 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -83,7 +83,7 @@ class YuthonWillTask(models.Model): document_ids = fields.Many2many('ir.attachment', string="附件") address = fields.Char(string='地点') start_date = fields.Date(string='开始日期', default=fields.Date.today) - is_this_company = fields.Boolean(string='是否为本公司', default=True) + is_this_company = fields.Boolean(string='本公司', default=True) task_state = fields.Selection([('will', '待办'), ('done', '已办'), ('cancel', '取消')], default='will', string='状态', store=True) @api.onchange('employee_ids', 'user_id') diff --git a/yuthon_will_task/views/yuthon_will_task_views.xml b/yuthon_will_task/views/yuthon_will_task_views.xml index 2ee087fee..eb2c3dec1 100644 --- a/yuthon_will_task/views/yuthon_will_task_views.xml +++ b/yuthon_will_task/views/yuthon_will_task_views.xml @@ -85,7 +85,7 @@ - +