27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import fields, models, api
|
|
from odoo.exceptions import UserError, ValidationError
|
|
from datetime import datetime, date, time, timedelta
|
|
|
|
|
|
class WorkflowLineWizard(models.TransientModel):
|
|
_name = 'workflow.line.wizard'
|
|
_description = '关联流程删除弹窗'
|
|
|
|
message = fields.Text(string='确认信息', readonly=True)
|
|
|
|
@api.model
|
|
def default_get(self, fields):
|
|
res = super(WorkflowLineWizard, self).default_get(fields)
|
|
if 'message' in fields and self.env.context.get('delete_message'):
|
|
res['message'] = self.env.context.get('delete_message')
|
|
return res
|
|
|
|
def action_confirm(self):
|
|
active_model = self.env.context.get('active_model')
|
|
active_ids = self.env.context.get('active_ids')
|
|
records = self.env[active_model].browse(active_ids)
|
|
# 携带确认标记执行删除
|
|
return records.with_context(confirm_delete=True).unlink() |