how to Customize User Name display on upper right corner in Odoo 16 using custom addons or studio . The idea is to display the role of the user like Manager , Billing etc
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Thanks . Where should i load this file in custom module
Hi Shibi,
You can try below solution:
- Add a role field with many2one/selection type on user or on partner level.
- Change the display name on the right corner with xpath in the rendering template.
Thanks.
I tried the xpath solution seems to be not working . Not sure if understand this "Add a role field with many2one/selection type on user or on partner level."
Hi Shibi,
Let me help you with the xpath:
<template id="show_email_on_login" inherit_id="portal.user_dropdown">
<xpath expr="//span[@t-if='_user_name']" position="replace">
<span t-if="_user_name" t-attf-class="#{_user_name_class}" t-esc="user_id.email[:23] + '...' if user_id.email and len(user_id.email) > 25 else user_id.email"/>
</xpath>
</template>
With this xpath, I am able to show email instead of the Customer name, similarly you can relace your field on above xpath with email to show ROLE .
Thanks
Thanks.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 6 22
|
3745 | ||
|
1
thg 9 19
|
6165 | ||
|
1
thg 4 17
|
5548 | ||
|
3
thg 3 15
|
11332 | ||
|
1
thg 3 15
|
3600 |
the question if there are 10 roles for a user, than which role you want to display?
we may have preference for the role , in my case user will only have one role