在 odoo 9 中关闭向导后显示成功消息的最佳解决方案是什么?
右上角有小弹出窗口吗?
这不是您问题的正确答案,但我遇到了同样的问题,问题是当用户单击向导上的提交按钮时,我必须显示“成功提交”消息。我已经这样做了作为我的解决方案
我已经做到了
- 我为向导创建了一个类
from odoo import api, fields, models, _
class CustomPopMessage(models.TransientModel):
_name = "custom.pop.message"
name = fields.Char('Message')
- 为自定义向导创建视图
<odoo>
<data>
<record id="custom_pop_message_wizard_view_form" model="ir.ui.view">
<field name="name">custom.pop.message.form</field>
<field name="model">custom.pop.message</field>
<field name="arch" type="xml">
<form string="Custom POP Message">
<field name="name" readonly="1"/>
<footer>
<button string="Close" class="btn-default" special="cancel"/>
</footer>
</form>
</field>
</record>
</data></odoo>
- 另一个向导的按钮方法,通过按下您想要显示某些弹出消息的按钮
def my_custom_button_function_for_another_wizard():
return {
'name': 'Message',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'custom.pop.message',
'target':'new',
'context':{'default_name':"Successfully Submitted."}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)