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

Hi odoo forum, i need help

i have these fields in my hr.employee model:

yearly_holidays_ids = fields.One2many('hr.employee.yearly.holidays','employee_id')
current_holiday_pool = fields.Integer()


And i have these fields in my hr.employee.yearly.holidays model:

employee_id= fields.Many2one('hr.employee', readonly=True)
year = fields.Integer(string='Year', readonly=True)
remaining_count=fields.Integer(string='Remaining', compute='_compute_remaining_count', store=True)

I want the value of current_holiday_pool in the hr.employee model to use the  value to that in the hr.employee.yearly.holidays model, the remaining_count field, and only the records for the current year (in this case 2021).

I need a compute field ?


Thank you for helping me out!


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 21
2479
Readonly in compute field แก้ไขแล้ว
3
ก.ย. 20
11282
How to find the field type? แก้ไขแล้ว
1
มิ.ย. 25
5079
0
ก.ค. 22
3698
3
ก.ค. 20
11716