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

Hii,

i want ro remove or hide the alert from the header part

how do we remove the class='alert alert-dismissible alert-info' or role alert from the header part

thanks in advance

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can inherit the view and using the xpath you can locate the required node and remove/replace it.

See a sample of xpath:


<xpath expr="//div[@role='alert']" position="replace"/>



Thanks

อวตาร
ละทิ้ง
ผู้เขียน

<record id="alert_crm_issue_form_inherit" model="ir.ui.view">
<field name="name">crm.issue.form.inherit</field>
<field name="model">crm.issue</field>
<field name="inherit_id" ref="crm_issue.crm_issue_view_form"/>
<field name="arch" type="xml">

<xpath expr="//div[@role='alert']" position="replace">
</xpath>

<!-- alert alert-dismissible alert-info-->

</field>
</record>
but it shows <xpath expr="//div[@role='alert']">' cannot be located in parent view

as the view referred in the inherit is a third party app, can you confirm that a div with role is existing in view: crm_issue_view_form

ผู้เขียน

yes its a thirty party app but when i save the form
<t t-name="translation-alert">
<t t-foreach="fields" t-as="field">
<div>
You have updated <strong><t t-esc="field.string"/></strong> (<t t-esc="lang"/>).
<a class="oe_field_translate" t-att-name="field.name" href="#">Update translations</a>
</div>
</t>
</t>
this alert will showing how can i remove this?