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

Hi dear Odooers,

How is it that some portal documents show even when the count is 0 and others don't? I'm really confused.

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

Hi,Here's a work around for you.
Add this to cssa.list-group-item.list-group-item-action.d-flex.align-items-center.justify-content-between.d-none[href="#link of the document in portal"] {
    display: flex !important;
}

Hope it helps

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

This actually solves the problem and I'm surprised. But do you have any idea how does it occur for sales and quotations?

Câu trả lời hay nhất

I was experimenting around with customizing the Portal as well and found that for the Sales and Quotations (sale module), there's a sale/static/src/js/sale_portal.js script that appears to "include" the keys for the counters into a function that suggests to keep displaying the included counters.

publicWidget.registry.PortalHomeCounters.include({    
/** * @override */
_getCountersAlwaysDisplayed() {
return this._super(...arguments).concat(['quotation_count','order_count']);
},});

I can't really find a clean way to remove sales and quotations from the view by extension/inheritance as there's nothing to xpath off in their template and as such I only could come up with 2 rather extreme options.

  1. xpath sales/quotations' t-call to the portal.portal_docs_entry template and replace them with an empty block.
  2. Add the following to "assets" in manifest, to remove the scripts that retain these 0 documents.
'web.assets_frontend': [('remove','sale/static/src/js/sale_portal.js') ],

The Portal doesnt seem to have been created with a particularly friendly structure as quite many base modules force their templates onto the portal view and it is almost impossible to pick and choose which of these documents can appear on the portal as you can't inherit those modules' portal templates to do much with xpath other than completely rewriting them (can't even conditionally render them via template t-ifs).

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 23
3312
0
thg 2 23
2221
1
thg 5 25
2017
2
thg 6 24
2307
0
thg 12 23
2401