
from odoo import fields, models


class HrEmployeeBase(models.AbstractModel):
    _name = "hr.employee.base"
    _description = "Basic Employee"
    _order = 'name'

    name = fields.Char()
    active = fields.Boolean("Active")
    department_id = fields.Many2one('hr.department', 'Department')
    job_id = fields.Many2one('hr.job', 'Job Position')
    job_title = fields.Char("Job Title")
    company_id = fields.Many2one('res.company', 'Company')
    address_id = fields.Many2one('res.partner', 'Work Address')
    work_phone = fields.Char('Work Phone')
    mobile_phone = fields.Char('Work Mobile')
    work_email = fields.Char('Work Email')
    work_location = fields.Char('Work Location')
    user_id = fields.Many2one('res.users')
    resource_id = fields.Many2one('resource.resource')
    resource_calendar_id = fields.Many2one('resource.calendar')


from odoo import fields, models


class HrEmployeeBase(models.AbstractModel):
    _name = "hr.employee.base"
    _description = "Basic Employee"
    _order = 'name'

    name = fields.Char()
    active = fields.Boolean("Active")
    color = fields.Integer('Color Index', default=0)
    department_id = fields.Many2one('hr.department', 'Department')
    job_id = fields.Many2one('hr.job', 'Job Position')
    job_title = fields.Char("Job Title")
    company_id = fields.Many2one('res.company', 'Company')
    address_id = fields.Many2one('res.partner', 'Work Address')
    work_phone = fields.Char('Work Phone')
    mobile_phone = fields.Char('Work Mobile')
    work_email = fields.Char('Work Email')
    work_location = fields.Char('Work Location')
    user_id = fields.Many2one('res.users')
    resource_id = fields.Many2one('resource.resource')
    resource_calendar_id = fields.Many2one('resource.calendar')

Add the color field to public employee
[FIX] hr: Add the color field to public employee

The color field is necessary to be able to display some fields
(many2many_tags) and used in the kanban views

closes odoo/odoo#35216

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>

closes odoo/odoo#35462

Signed-off-by: Romain Libert (rli) <d3a53ea3f0d6ebbbf1eb8431093f132bc4577d93@odoo.com>
  
  from odoo import fields, models
  
  
  class HrEmployeeBase(models.AbstractModel):
      _name = "hr.employee.base"
      _description = "Basic Employee"
      _order = 'name'
  
      name = fields.Char()
      active = fields.Boolean("Active")
+     color = fields.Integer('Color Index', default=0)
      department_id = fields.Many2one('hr.department', 'Department')
      job_id = fields.Many2one('hr.job', 'Job Position')
      job_title = fields.Char("Job Title")
      company_id = fields.Many2one('res.company', 'Company')
      address_id = fields.Many2one('res.partner', 'Work Address')
      work_phone = fields.Char('Work Phone')
      mobile_phone = fields.Char('Work Mobile')
      work_email = fields.Char('Work Email')
      work_location = fields.Char('Work Location')
      user_id = fields.Many2one('res.users')
      resource_id = fields.Many2one('resource.resource')
      resource_calendar_id = fields.Many2one('resource.calendar')
  
Add the color field to public employee
## Code Before:

from odoo import fields, models


class HrEmployeeBase(models.AbstractModel):
    _name = "hr.employee.base"
    _description = "Basic Employee"
    _order = 'name'

    name = fields.Char()
    active = fields.Boolean("Active")
    department_id = fields.Many2one('hr.department', 'Department')
    job_id = fields.Many2one('hr.job', 'Job Position')
    job_title = fields.Char("Job Title")
    company_id = fields.Many2one('res.company', 'Company')
    address_id = fields.Many2one('res.partner', 'Work Address')
    work_phone = fields.Char('Work Phone')
    mobile_phone = fields.Char('Work Mobile')
    work_email = fields.Char('Work Email')
    work_location = fields.Char('Work Location')
    user_id = fields.Many2one('res.users')
    resource_id = fields.Many2one('resource.resource')
    resource_calendar_id = fields.Many2one('resource.calendar')

## Instruction:
Add the color field to public employee
## Code After:

from odoo import fields, models


class HrEmployeeBase(models.AbstractModel):
    _name = "hr.employee.base"
    _description = "Basic Employee"
    _order = 'name'

    name = fields.Char()
    active = fields.Boolean("Active")
    color = fields.Integer('Color Index', default=0)
    department_id = fields.Many2one('hr.department', 'Department')
    job_id = fields.Many2one('hr.job', 'Job Position')
    job_title = fields.Char("Job Title")
    company_id = fields.Many2one('res.company', 'Company')
    address_id = fields.Many2one('res.partner', 'Work Address')
    work_phone = fields.Char('Work Phone')
    mobile_phone = fields.Char('Work Mobile')
    work_email = fields.Char('Work Email')
    work_location = fields.Char('Work Location')
    user_id = fields.Many2one('res.users')
    resource_id = fields.Many2one('resource.resource')
    resource_calendar_id = fields.Many2one('resource.calendar')
