Skip to content

Commit

Permalink
Merge pull request #3766 from ForgeFlow/9.0-fix-hr-constraint
Browse files Browse the repository at this point in the history
[9.0][FIX] hr: delete safely constraint
  • Loading branch information
pedrobaeza committed Mar 14, 2023
2 parents 00ee0bc + 3cca332 commit 30b6c22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions addons/account/migrations/9.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import logging
import operator
from openupgradelib import openupgrade, openupgrade_90
from openerp.modules.registry import RegistryManager
from psycopg2.extensions import AsIs

_logger = logging.getLogger('account.migrations.9.0.1.1.post_migration')
Expand Down Expand Up @@ -1393,9 +1392,8 @@ def migrate(env, version):
"""
)

registry = RegistryManager.get(cr.dbname)
openupgrade.m2o_to_x2m(
cr, registry['account.bank.statement.line'],
cr, env['account.bank.statement.line'],
'account_bank_statement_line',
'journal_entry_ids',
openupgrade.get_legacy_name('journal_entry_id'),
Expand Down
4 changes: 4 additions & 0 deletions addons/hr/migrations/9.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ def migrate(env, version):
('module', '=', 'base'),
('name', '=', 'group_hr_attendance'),
]).write({'noupdate': 0})
# Disappeared constraint
openupgrade.delete_sql_constraint_safely(
env, "hr", "hr_job", "hired_employee_check"
)

0 comments on commit 30b6c22

Please sign in to comment.