[IMP] contact: Add a color picker on the 'Contact Tags' sections

PURPOSE

This commit aims to improve the 'Contact Tags' sections of the 'Contact'
module by adding a color picker (on the list and the form view).

SPECS

- Add a color picker on the 'Contact Tags' sections (i.e: list and form view)
- Add a placeholder for the 'name' field of the form view.
- Update the label of the 'color' field.

LINKS

Task id: 2608410

closes odoo/odoo#74033

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Julien Banken
2021-07-20 11:34:40 +00:00
parent 4f07d86026
commit 58dc01a9a0
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ class PartnerCategory(models.Model):
return randint(1, 11)
name = fields.Char(string='Tag Name', required=True, translate=True)
color = fields.Integer(string='Color Index', default=_get_default_color)
color = fields.Integer(string='Color', default=_get_default_color)
parent_id = fields.Many2one('res.partner.category', string='Parent Category', index=True, ondelete='cascade')
child_ids = fields.One2many('res.partner.category', 'parent_id', string='Child Tags')
active = fields.Boolean(default=True, help="The active field allows you to hide the category without removing it.")
+4 -2
View File
@@ -614,9 +614,10 @@
<form string="Contact Tag">
<sheet>
<group col="4">
<field name="name"/>
<field name="active" widget="boolean_toggle"/>
<field name="name" placeholder='e.g. "Consulting Services"'/>
<field name="color" widget="color_picker"/>
<field name="parent_id"/>
<field name="active" widget="boolean_toggle"/>
</group>
</sheet>
</form>
@@ -630,6 +631,7 @@
<field name="arch" type="xml">
<tree string="Contact Tags">
<field name="display_name"/>
<field name="color" widget="color_picker"/>
</tree>
</field>
</record>