23 lines
728 B
Python
23 lines
728 B
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")
|
|
comment = fields.Char(required=True)
|
|
|
|
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()
|