In Expense Reports menu, there is a list of all reports. If I check one of them which status still 'Submitted', 'Approve Report' button will be shown above the list. For a reason, I want to hide that button at any conditions. Would anyone help me to customize the UI in debug mode? FYI, I use odoo 18. Thank you.
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ờ
Hi Sarah Ayu Nanda,
If you want to always hide the "Approve Report" button on the expense report list view, you cannot directly make the button invisible using debug mode. Instead, you need to hide it using custom code, as the button's visibility is controlled through JavaScript logic.
To do this, you need to override the method that determines the button's visibility in the HrExpenseListController. You can patch the displayApprove method to always return false.
JavaScript Code:
//Code in Comment//
This will ensure the "Approve Report" button is always hidden.
I hope this helps!
Feel free to reach out if you have any questions — happy to help!
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Code :
/** @odoo-module **/
import { ExpenseListController } from "@hr_expense/views/list";
import { patch } from "@web/core/utils/patch";
patch(ExpenseListController.prototype, {
displayApprove() {
return false;
},
});
In your module’s __manifest__.py, include the JS file like this:
'assets': {
'web.assets_backend': [
'your_module/static/src/views/your_file.js',
],
},
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 | |
---|---|---|---|---|
|
0
thg 3 15
|
4753 | ||
|
1
thg 6 16
|
8621 | ||
|
1
thg 8 25
|
255 | ||
|
1
thg 8 25
|
204 | ||
|
0
thg 7 25
|
486 |
thank you Jainesh. my team's already solved this case same as the way you suggest here.