Odoo Help

0

0
2 Answers
2
Avatar
--Sushma--

Techno-Functional Associate with 4+ years of experience in Odoo (formerly known as OpenERP).

Sushma
17.01.19, 06:05

Hi Bassam,

Seems you query is not so clear. But looking to your code.

1. vications = self.env['hr.employee'].search([]), This search will give you all employees objects like hr.employee(1,2,3) etc.

2. emp=vications.mapped('emplyee_id'),  There is no employee_id field, though you already got done search for all employee using above code, so this statement really not needed.

3.lopping  from emp instead use for emp in self.env['hr.employee'].search([]):

Thanks



0
Bassam Alsibai
17.01.19, 06:45

contract module does have employee_id field i changed the code 


vications = self.env['hr.contract'].search([])
emp=vications('emplyee_id')
for em in emp:
vd = 20
leave = self.env['hr.holidays'].create({
'employee_id': em,
'holiday_status_id': '1',
'type': 'add',
'holiday_type': 'employee',
'number_of_days_temp': vd
})
leave.action_approve()
if leave.double_validation:
leave.action_validate()

get this error TypeError: 'hr.contract' object is not callable
Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now