콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4111 화면

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.

아바타
취소
관련 게시물 답글 화면 활동
0
7월 25
130
1
7월 25
4903
0
7월 25
430
0
6월 25
573
1
6월 25
753