Skip to Content
Menu
This question has been flagged
1016 Views

Hello,

I want to skill tap for hr employees, so first I add configuration for technical and nontechnical skills and create one2many relation between the employee and my model 

but I do not know how to display it as lines.


here's my code:


from odoo import models, fields, api

class EmployeeTechSkills(models.Model):
_name = 'employee.tech'
_description = 'tech skill tap for employee'
_rec_name = "name"

name = fields.Char(string='Name',required=True)

class EmployeeTechSkills(models.Model):
_name = 'tech.tap'
_description = 'tech skill for employee'

tech_id = fields.Many2one('employee.tech', 'Technical Skills')

employee_id = fields.Many2one('hr.employee',)

levels = fields.Selection([('basic', 'Basic'),
('medium', 'Medium'),
('advance', 'Advance')], 'Levels')


class EmployeeNonTechSkills(models.Model):
_name = 'employee.nontech'
_description = 'nontech skill for employee'
_rec_name="name"

name = fields.Char(string='Name',required=True)

class EmployeeNonTechSkills(models.Model):
_name = 'nontech.tap'
_description = 'nontech skill tap for employee'

non_tech_id = fields.Many2one('employee.nontech')
employee_id = fields.Many2one('hr.employee', )
levels = fields.Selection([('basic', 'Basic'),
('medium', 'Medium'),
('advance', 'Advance')], 'Levels')

class employee(models.Model):
_name = 'hr.employee'
_inherit ='hr.employee'


#non_tech_lines = fields.One2many("employee.nontech", 'non_tech_id', string=" non technical skills", required=True)
tech_id = fields.Many2one('employee.tech', 'Technical Skills',)
non_tech_id = fields.Many2one('employee.nontech', ' Non Technical Skills',)
tech_skill_ids = fields.One2many("tech.tap", 'employee_id', string="technical skills",)
non_tech_skill_ids = fields.One2many("nontech.tap", 'employee_id', string=" non technical skills",)
employee_id = fields.Many2one('hr.employee', string="Employee Name")
Mentor_id = fields.Many2one('hr.employee', 'Mentor')

Views:

/

xml version="1.0" encoding="utf-8"?>

id="Employee_NonTech_skill_form" model="ir.ui.view">
name="name">nontech.skill.form
name="model">hr.employee
name="inherit_id" ref="hr.view_employee_form"/>
name="arch" type="xml">

expr="//field[@name='coach_id']" position="replace">
name="Mentor_id"/>






position='inside'>
string="Master Data">



name="first_name" string="First Name"/>
name="medium_name" string="Middle Name"/>
name="last_name" string ="Last Name"/>
name="employee_grade"/>



name="job_title_id"/>







string="Skills">
string="Technical Skills"/>

name="tech_skill_ids"/>
editable="bottom">
name="tech_id"/>

name="employee_id" invisible="1"/>











string="Non Technical Skills"/>

name="non_tech_skill_ids"/>

















Thank you in advance for any help







Avatar
Discard
Related Posts Replies Views Activity
3
Oct 23
5973
1
Sep 23
1962
1
May 23
1000
2
Apr 23
1374
1
Mar 23
996