Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5581 มุมมอง

I need to hide buttons from form header from Portal Users, but I want to leave the Statusbar widget visible. In the view I've added spans for buttons and status field like this:

<header class="oe_header">
     <span attrs="{'invisible': [('is_portal_user','=',True)] }">
         <button name="case_open_do_mnie" string="Open" type="object" class="oe_highlight" states="draft"  />
         <button name="make_issue" string="Make Issue" type="object" class="oe_highlight" states="open,answer"  />
     <button name="case_close" string="Close Case" type="object" states="draft,answer,open"  />
     <button name="case_close" string="Close Case" type="object" states="resolved" class="oe_highlight"  />
     <button name="case_reset" string="Reset to Draft" type="object" states="cancel,done"  />
     <button name="case_cancel" string="Cancel Case" type="object" states="open,issue,answer,resolved,done"  />
</span>
<span>
        <field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,open,done" 
                            statusbar_colors='{"open":"blue", "issue":"blue", "answer":"blue", "resolved":"red", "done":"blue"}'                            
    /> 
</span>

</header>

But it resulted in bad formatted header line (see picture below) - status bar is cropped. Is there a way to hide the buttons from header and preserve right height of header line for status bar?

image description

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Removed span around state field and it gave right result.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 23
112
1
พ.ค. 24
1476
2
มี.ค. 23
9970
Cacher le bouton "créer" d'une liste แก้ไขแล้ว
2
มี.ค. 23
2411
Add class to button from function แก้ไขแล้ว
2
พ.ค. 22
4349