This question has been flagged
3182 Views

I have a requirement that each time users log in to the server, they have to see some 'Home Page'

In my case, users have to see some announcement in HTML webpage.

Is it possible to create this?

I have tried some but it's not perfect.

My progress are :

  1. Able to view the announcement by HTML

  2. Got stuck in going back to normal OE view. (Since the method hides the topbar and sidebar)

Here is my method :

  1. Users first view is 'view_home_form'

    <record id="view_home_form" model="ir.ui.view">
        <field name="name">menu.home.form</field>
        <field name="model">menu.home</field>
        <field name="arch" type="xml">
        <form string="home" version="7.0">
                <sheet>
                    <div class="oe_right oe_button_box" name="button_box">
                        <button name="method_name" string="Open Form" type="object"/>
                    </div>
                    <field name="name" widget="html" readonly="1" nolabel="1"/>
                    <html>
                        <style> .openerp .oe_view_manager table.oe_view_manager_header { display:none } </style>
                        <style> .openerp .oe_topbar { display: none;} </style>
                        <style> .openerp .oe_form_sheet_width { min-width: 950px;
                                max-width: 1560px; height:1000px background-color: #FFFF00} </style>
                    </html>
                </sheet>
            </form>
        </field>
    </record>
    
  2. Which is defined by the action

    <record id="action_menu_home_project2" model="ir.actions.act_window" >
        <field name="name">First Menu</field>
        <field name="res_model">menu.home</field>           
        <field name="context">{'search_default_mine':1}</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
    </record>
    
  3. This is the function of button

    def method_name(self, cr, uid, ids, context=None): return { 'view_type': 'form', 'view_mode': 'form', 'context': context, 'res_model': 'hr.employee', 'nodestroy': False, }

The conclusion is : I have a problem that my OE view is not turning back to normal. The sidebar and topbar are hidden forever.

Avatar
Discard