OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Change dot color selection field

  • Thread starter Thread starter Rahma Begag
  • Start date Start date
R

Rahma Begag

Guest
enter image description here My objective is to add a new state_selection widget (in the same way as the one that is present in the Kanban view of the tasks of the project module) with three (3) options / colors :

  • gray
  • Orange
  • Red

I mean, I want the new state to have a new color, for example, orange.

Preferably, I would like to do it myself if it is not too complicated; otherwise, an existing module will do the trick.

I have no idea how to do it, and I can't find any documentation on it. Can you help me or indicate a module to do this simply?

this is the xml code

Code:
<xpath expr="//field[@name='kanban_state']" position="replace">
                <field name="kanban_state_child" widget="state_selection"/>
</xpath>

and this is the field definition

Code:
kanban_state_child = fields.Selection([
        ('on_hold', 'En attente'),
        ('normal', 'En cours'),
        ('done', 'Prêt'),
        ('blocked', 'Bloquée')], string='Status',
        copy=False, default='on_hold', required=True, readonly=False, store=True)
<p><a href="https://i.sstatic.net/pwtrBIfg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pwtrBIfg.png" alt="enter image description here" /></a>
My objective is to add a new state_selection widget (in the same way as the one that is present in the Kanban view of the tasks of the project module) with three (3) options / colors :</p>
<ul>
<li>gray</li>
<li>Orange</li>
<li>Red</li>
</ul>
<p>I mean, I want the new state to have a new color, for example, orange.</p>
<p>Preferably, I would like to do it myself if it is not too complicated; otherwise, an existing module will do the trick.</p>
<p>I have no idea how to do it, and I can't find any documentation on it. Can you help me or indicate a module to do this simply?</p>
<p>this is the xml code</p>
<pre><code><xpath expr="//field[@name='kanban_state']" position="replace">
<field name="kanban_state_child" widget="state_selection"/>
</xpath>
</code></pre>
<p>and this is the field definition</p>
<pre><code>kanban_state_child = fields.Selection([
('on_hold', 'En attente'),
('normal', 'En cours'),
('done', 'Prêt'),
('blocked', 'Bloquée')], string='Status',
copy=False, default='on_hold', required=True, readonly=False, store=True)
</code></pre>
 
Top