Merge pull request #2026 from expsa/samir-aladawi-transactions-improvements

[FIX] exp_transaction_leave: domain in leave
This commit is contained in:
SamirLADOUI-sa 2025-01-01 09:18:47 +01:00 committed by GitHub
commit 58140a19e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -114,9 +114,9 @@ class LeaveLine(models.Model):
def onchange_leave_id(self):
domain = {}
if self.leave_id:
domain = {'unit_id': [('id', 'in', self.env['cm.entity'].search([('type', '=', 'unit'),
('parent_id', '=',
self.leave_id.employee_id.id)]).ids)]}
domain = {'unit_id': [('id', 'in', self.env['cm.entity'].search([('type', '=', 'employee'),
('employee_id', '=',
self.leave_id.employee_id.employee_id.id)]).parent_id.ids)]}
return {'domain': domain}
@api.onchange('unit_id')