Files
gzth/soong_workflow/wizard/soong_workflow_comment_wizard.py
T
2024-09-10 11:51:09 +08:00

28 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class SoongWorkflowCommentWizard(models.TransientModel):
_name = "soong.workflow.comment.wizard"
_description = "Soong Workflow Comment Wizard"
res_model = fields.Char()
res_id = fields.Integer()
log_ids = fields.Many2many(comodel_name="soong.workflow.log")
node_btn_id = fields.Many2one(comodel_name="soong.workflow.node.button")
button_type = fields.Selection([('trans', '转交'), ('other', '其他')], string="按钮类型", default='other')
comment_note_id = fields.Many2one('soong.note', required=True, string="意见")
comment_type = fields.Selection(related="comment_note_id.type", string="意见类型")
comment_return_type = fields.Char(related="comment_note_id.return_type", string="退回类型")
state_list = fields.Char(string="状态列表")
employee_ids = fields.Many2many('hr.employee', string="提醒经办人")
notice_message = fields.Char(string="消息通知")
def add_comment(self):
self.ensure_one()
cx = self.env.context.copy() or {}
self.log_ids.write({"comment": self.comment})
return self.node_btn_id.with_context(cx).run()