Skip to content

Commit

Permalink
Merge pull request #1846 from Eficent/12.0-fix-hr_holidays
Browse files Browse the repository at this point in the history
[12.0][FIX] hr_holidays: assure ids before renaming models
  • Loading branch information
pedrobaeza committed May 22, 2019
2 parents 9528af8 + f676636 commit b5c8c52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addons/hr_holidays/migrations/12.0.1.5/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def fill_hr_leave(env):
RETURNING id""", (AsIs(openupgrade.get_legacy_name('type')), ),
)
ids = [x[0] for x in env.cr.fetchall()]
_move_model_in_data(env, ids, 'hr.holidays', 'hr.leave')
if ids:
_move_model_in_data(env, ids, 'hr.holidays', 'hr.leave')


def fill_hr_leave_request_dates(cr):
Expand Down Expand Up @@ -113,7 +114,8 @@ def fill_hr_leave_allocation(env):
RETURNING id""", (AsIs(openupgrade.get_legacy_name('type')), ),
)
ids = [x[0] for x in env.cr.fetchall()]
_move_model_in_data(env, ids, 'hr.holidays', 'hr.leave.allocation')
if ids:
_move_model_in_data(env, ids, 'hr.holidays', 'hr.leave.allocation')


def set_max_sequences(env):
Expand Down

0 comments on commit b5c8c52

Please sign in to comment.