I need to control the width of the column product in purchase order tree view Odoo v16 but no inline css is working neither are css or scss classes working. It seems like the many2one functionality or widgets of the field is over-riding any css commands or classes I give. I have tried other solutions too from the forum but nothing helps. Any help in this regard would be appreciated.
Thanks!
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! I actually solved this problem on my own. Here is how I did it:
1. I created a css file in my module.
2. I created a custom class and defined the width in there like below:
3. Then I added this class as a widget to the field:
This worked perfectly but there was a draw back, If I used this on the uom field it stopped showing units of measure but other field worked fine.
Thanks for the help though, really appreciate it :)
How do you add the css?
In the manifest or with inherit? Whats the process to add CSS to Odoo frontend
@Sven sailor Salazar, It really depends on the version you are using. In later versions you have to put your CSS file in folder structure static/src/css/custom_css.css and you need to add it in manifest file like: 'assets': {
'web.assets_backend': ['my_module/static/src/css/custom_css.css']
},
But in older versions it is linked in an xml file and the xml file is added in manifest like views and other xml files are added:
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="assets_backend" name="open_academy assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/css" href="/ol_custom_with/static/src/css/style.css"/>
</xpath>
</template>
</odoo>
Hi,
Try this code below to adjust the width,
th.o_column_sortable[data-name="field_name"]
{
width:150px !important;
max-width:150px !important;
}
Hope it helps
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 12 21
|
1833 | ||
Changing column widths tree view
Đã xử lý
|
|
11
thg 10 24
|
99842 | |
|
0
thg 11 23
|
1551 | ||
|
2
thg 5 25
|
2099 | ||
|
3
thg 4 25
|
4705 |