[IMP] hr: add a color picker on department form view and list view

Before this commit, If user want to change color of department the only way to
do that is by clicking on three dot menu in kanban view.
In this commit, added a color picker on department's form view and list view and
make list view editable so user can change color of department from form view
and list view. so it can be used for a hierarchy view.

task-3489447

closes odoo/odoo#134964

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
pash-odoo
2023-10-12 16:11:54 +00:00
parent 0441f7c0d0
commit 28824a07c5
+6 -3
View File
@@ -25,6 +25,7 @@
<field name="parent_id"/>
<field name="child_ids" invisible="1"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="color" widget="color_picker" string="Color"/>
</group>
<div invisible="not id or id and not child_ids and not parent_id">
<widget name="hr_department_chart"/>
@@ -43,12 +44,14 @@
<field name="name">hr.department.tree</field>
<field name="model">hr.department</field>
<field name="arch" type="xml">
<tree string="Companies" sample="1">
<field name="display_name"/>
<field name="company_id" groups="base.group_multi_company"/>
<tree string="Companies" sample="1" editable="bottom">
<field name="company_id" column_invisible="True"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
<field name="manager_id" widget="many2one_avatar_user"/>
<field name="total_employee" string="Employees"/>
<field name="parent_id"/>
<field name="color" widget="color_picker" string="Color"/>
</tree>
</field>
</record>