Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1016 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

<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

Tác giả

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?