| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 28 |
| Technical Name |
noi_color_picker |
| License | LGPL-3 |
| Website | http://nexorionis.odoo.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 28 |
| Technical Name |
noi_color_picker |
| License | LGPL-3 |
| Website | http://nexorionis.odoo.com |
Color Picker Widget
Module: Color Picker Widget
Author: NexOrionis Techsphere
Purpose: This module provides a simple color picker for Char fields. The selected color is saved as a HEX string (e.g., #FF5733).
Installation
- Place the module folder
noi_color_pickerin your Odoo addons directory. - Update apps list in Odoo.
- Install the module Color Picker Widget from Apps.
Usage
To use the color picker in a model:
color_code = fields.Char(string="Color Code")
In the XML form view, add the widget:
<field name="color_code" widget="noi_color_picker"/>
Example:
<form string="Company">
<sheet>
<group>
<field name="color_code" widget="noi_color_picker"/>
</group>
</sheet>
</form>
Features
- Simple color input for
Charfields. - Displays a live preview of the selected color.
- Supports HEX codes directly.
- Readonly mode supported automatically.
- Fully compatible with Odoo 17 backend assets system.
Notes
- The value is stored in the database as a string.
- Works in desktop and mobile views.
- Can be combined with other form logic, like changing color automatically based on state.
File Structure
noi_color_picker/
├─ __manifest__.py
├─ static/
│ ├─ src/
│ │ ├─ js/
│ │ │ ├─ color_picker_field.js
│ │ │ └─ color_picker_field.xml
│ └─ description/
│ └─ index.html
└─ views/ (if needed)
Support
For issues or questions, contact nexorionis.info@gmail.com.
Please log in to comment on this module