Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1134 มุมมอง

Hi

I am working with Odoo enterprise v16

I have two pages: Job Position page(model: hr.job) and Employee page(model:hr.employee). Job Position page has items as depicted below where the job pos and req skills are inputted manually on the page.

What I want to do: on the Employee page, I want to show ALL of those req skills when selected a Job Position. Currently I successfully show the Job Position with many2one, what to do next so the req skills also appears on the page? Thanks!

 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can use the below code.


class HREmployee(models.Model):

    _inherit = 'hr.employee'


    job_position_id = fields.Many2one('hr.job', string='Job Position')

    req_skills = fields.Many2many('hr.skill', related='job_position_id.req_skills', string='Required Skills')


Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน

Hi, thank you so much but honestly I don't know where to put the code. I am working with Odoo enterprise web based anyway, so currently I do those things with Odoo studio

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 23
1542
0
พ.ย. 21
2456
3
ก.ค. 25
22184
2
มี.ค. 24
1727
0
ก.ย. 23
144