Error in solution for "2.3. Add a dashboard item"
Maintainer thường phản hồi trong vòng 1 ngày
@fdardenne đang làm issue này rồi.
Từ ngày 5/1/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Hi,
The assignment has us create a dashboard item, with optional size prop, that should default to 1. That should be reflected in the size of the displayed element.
This is the solution provided: dashboard_item.js
And it's used like this in the Dashboard: dashboard.xml
However, if the prop isn't provided, this is what appears:
<div class="card m-2 border-dark" style="width: NaNrem;"><div class="card-body">some content </div></div>
It looks like I'm not imagining this since it appears to be included in the relevant screenshot as well:
https://www.odoo.com/documentation/18.0/_images/dashboard_item.png
If the elements containing "some content" truly were 18rem wide, they'd be about half of what the element containing "I love milk" is.
I solved it myself by adding setup() in DashboardItem:
setup() { this.size = 1; if(this.props.size && this.props.size > 0) { this.size = this.props.size; } }
And adjusting line 5 in dashboard_item.xml:
<div class="card d-inline-block m-2" t-attf-style="width: {{18*size}}rem;">
Is there a way to make it work with the default value for the size prop though?
- Ngôn ngữ chính
- Python
- Star
- 182
- Fork
- 3.4k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của odoo/tutorials
-
awesome_owl module shows error: A css error occured, using an old style to render this pageCó thể làm lại được @fdardenne đã nhận 392 ngày trước và không có pull request nào đang mở. Đang mở
odoo/tutorials#1012 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của odoo/tutorials
Issue tương tự
-
MarkdownDocSerializer.post_process escapes '\<' to '\<', rendering literal '<' in CommonMarkĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
docling-project/docling-core#1067 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
correction metadata
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
acl-org/acl-anthology#11101 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] crewai tool create/install/login exit 0 when they failCó thể đã có người làm @Kiko0301 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vllm-project/compressed-tensors#1033 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
chore kaizen ui-rewrite
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
IBM/mcp-context-forge#7681 ·
Maintainer thường phản hồi trong vòng 2 ngày