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

I have to remove the following view from my custom module i tried to inherit from both website_sale_stock and website_portal_sale but no luck


<template id="orders_followup_shipping" name="Orders Shipping Followup" inherit_id="website_portal_sale.orders_followup">
<xpath expr="//div[@id='shipping_address']" position="inside">
<t t-if="order.picking_ids">
<div>
<strong>Delivery Orders</strong>
</div>
<div>
<t t-foreach="order.picking_ids" t-as="i">
<t t-set="report_url" t-value="'/report/pdf/stock.report_picking/%s' % i.id"/>
<div>
<a t-att-href="report_url"><span class="fa fa-download"/></a>
<a t-att-href="report_url"><span t-field="i.name"/></a>
<span class="text-muted" t-field="i.date" t-field-options='{"widget": "date"}'/>
<t t-if="i.state == 'done'">
<span class="label label-success label-text-align"><i class="fa fa-fw fa-truck"/> Shipped</span>
</t>
<t t-if="i.state == 'partially_available'">
<span class="label label-warning label-text-align"><i class="fa fa-fw fa-clock-o"/> Partially Available</span>
</t>
<t t-if="i.state == 'cancel'">
<span class="label label-danger label-text-align"><i class="fa fa-fw fa-times"/> Cancelled</span>
</t>
<t t-if="i.state in ['draft', 'waiting', 'confirmed', 'assigned']">
<span class="label label-info label-text-align"><i class="fa fa-fw fa-clock-o"/> Preparation</span>
</t>
</div>
</t>
</div>
</t>
</xpath>
</template>

and this view is inherited from website_portal_sale.orders_followup template i need to remove the  template. how can i inherit and replace the view .can any one suggest correct xpath

Thanks in advance.

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

Hello,

Have you tried inheriting this view and replacing it

<template id="your_id" name="Orders Shipping Followup" inherit_id="website_sale_stock.orders_followup_shipping">
<xpath expr="//t[@t-foreach='order.picking_ids']" position="replace">


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

Thanks i will check that

Tác giả Câu trả lời hay nhất

correct answer would be like this 



<template id="orders_followup_inherit_stock" name="Orders Followup Inherit" inherit_id="website_sale_stock.orders_followup_shipping">
<xpath expr="//t[@t-if='order.picking_ids']" position="replace">
</xpath>
</template>
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 16
7202
2
thg 4 25
7169
3
thg 2 23
22241
0
thg 8 22
3111
0
thg 12 20
3556