Show successfully message after close wizard in odoo v9

孤街醉人 提交于 2019-12-07 15:17:23

问题


What is best solution for display successfully message after close wizard in odoo 9?

Any small popup in right corner?


回答1:


It's not a proper answer to your question but i have faced the same problem, the problem was that i have to display "successfully submitted" message when user click on submit button on a wizard. and i have done this as my solution i have done this

  1. i have created one class for the wizard
from odoo import api, fields, models, _

class CustomPopMessage(models.TransientModel):
_name = "custom.pop.message"

    name = fields.Char('Message')
  1. create view for custom wizard
    <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>
  1. button method of another wizard by pressing that button you want to display certain Pop-Up massage
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."} 
            }


来源:https://stackoverflow.com/questions/45050001/show-successfully-message-after-close-wizard-in-odoo-v9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!