In this comprehensive guide, I’ll show you how to Customize Odoo List View by adjusting field widths and hiding labels. These techniques help create cleaner, more user-friendly interfaces in your Odoo applications.
Understanding List View Basics
The Odoo list view provides a tabular display of records with various customization options. Here’s the basic structure we’ll work with:
<record id="wb_hobby_list_view" model="ir.ui.view">
<field name="name">wb.hobby.list.view</field>
<field name="model">wb.hobby</field>
<field name="arch" type="xml">
<list default_order="name, create_date desc" limit="10" editable="bottom" multi_edit="1">
<field name="show" nolabel="1"/>
<field name="optional" hide="1"/>
<field name="create_date" optional="hide"/>
<field name="name" width="500px"/>
</list>
</field>
</record>
Customizing Field Widths
To adjust field widths in your list view, follow these steps:
- Add the
widthattribute to your field definition:
<field name="name" width="500px"/>
- You can specify widths using:
- Pixels (px)
- Percentages (%)
- Em units (em)
Best practices for width settings:
- Use pixels for fixed-width columns
- Use percentages for responsive layouts
- Keep widths proportional to content
Hiding Field Labels
To hide field labels in the list view:
- Add the
nolabelattribute:
<field name="show" nolabel="1"/>
- Alternative method using optional hiding:
<field name="optional" hide="1"/>
Advanced List View Features
The list view supports several advanced features:
- Default Ordering:
<list default_order="name, create_date desc">
This orders records by name ascending and creation date descending.
- Record Limits:
<list limit="10">
Restricts the number of visible records.
- Inline Editing:
<list editable="bottom" multi_edit="1">
Enables record editing directly in the list view.
Optional Fields Configuration
Odoo allows users to show/hide optional fields:
<field name="create_date" optional="hide"/>
Options include:
optional="hide": Hidden by defaultoptional="show": Visible by default
Implementation Best Practices
- Field Organization:
- Place required fields first
- Group related fields together
- Consider user workflow
- Performance Optimization:
- Limit visible fields
- Use appropriate field types
- Consider loading speed
- User Experience:
- Maintain consistent widths
- Use clear field names
- Provide adequate spacing
Troubleshooting Common Issues
- Width Not Applying:
- Verify XML syntax
- Check CSS conflicts
- Ensure proper module installation
- Label Issues:
- Confirm attribute spelling
- Check inheritance hierarchy
- Verify view loading
Integration with Other Views
The list view often works alongside:
- Form Views:
<form>
<sheet>
<!-- Form fields -->
</sheet>
</form>
- Search Views:
<search>
<!-- Search filters -->
</search>
Additional Resources
For more information, visit:
Conclusion
Customizing Odoo list views enhances user experience and application functionality. By properly implementing width adjustments and label management, you create more efficient and user-friendly interfaces.
Remember to:
- Test changes thoroughly
- Consider user feedback
- Document customizations
- Follow Odoo development guidelines
This comprehensive approach ensures your list views meet both technical requirements and user needs while maintaining performance and scalability.
Discover more from teguhteja.id
Subscribe to get the latest posts sent to your email.


Pingback: Odoo Tutorials February 2025 - teguhteja.id