有两种方法,通过它可以做到这一点,
1)按钮,可以添加一个名为确认该定义的特殊的领域,而且,独自一人,会做你想要什么。例如:
<button name="Name of the button"
string="Showable label"
type="object"
confirm="Are you sure you want to do this?"
/>
这将弹出一个确认窗口,显示文本“你确定要这样做?”。
2)您可以创建一个向导,使用两个Button,一个类型特殊取消,另一个执行一个函数,该函数也将调用工作流中的confirm函数。
例子:
<record id="view_cancel_repair" model="ir.ui.view">
<field name="name">Cancel Repair</field>
<field name="model">mrp.repair.cancel</field>
<field name="arch" type="xml">
<form string="Cancel Repair Order" version="7.0">
<group>
<label string="This operation will cancel the Repair process, but will not cancel it's Invoice. Do you want to continue?"/>
</group>
<footer>
<button name="cancel_repair" string="Yes" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
我希望这可以帮助你! 感谢和问候