Skip to content

Commit ce6984d

Browse files
committed
[FIX] hr_holidays: fix ambiguous column
Use fully qualified names as columns in related table can have a same name and this query could raise an error. Like the one below error below was shown in 18.0 ``` psycopg2.errors.AmbiguousColumn: column reference "state" is ambiguous LINE 3: AND state = 'validate' ``` closes odoo#193568 Signed-off-by: Jurgen Gjini (jugj) <[email protected]>
1 parent 7a88199 commit ce6984d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/hr_holidays/models/res_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _get_on_leave_ids(self, partner=False):
5454
AND hr_leave.state = 'validate'
5555
AND hr_leave.active = 't'
5656
AND res_users.active = 't'
57-
AND date_from <= %%s AND date_to >= %%s''' % field, (now, now))
57+
AND hr_leave.date_from <= %%s AND hr_leave.date_to >= %%s''' % field, (now, now))
5858
return [r[0] for r in self.env.cr.fetchall()]
5959

6060
def _clean_leave_responsible_users(self):

0 commit comments

Comments
 (0)