[FIX] runbot: fix upgrade to 17.0

This commit is contained in:
Xavier-Do 2024-02-05 10:25:13 +01:00
parent 6dd2580e21
commit be95c8b364

View File

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
import logging
try:
from odoo.upgrade import util
except ImportError:
util = None
_logger = logging.getLogger(__name__)
def migrate(cr, version):
if util:
util.remove_field(cr, "runbot.build.config", "message_main_attachment_id")
util.remove_field(cr, "runbot.build.config.step", "message_main_attachment_id")
util.remove_field(cr, "runbot.build.error", "message_main_attachment_id")
util.remove_field(cr, "runbot.error.regex", "message_main_attachment_id")
util.remove_field(cr, "runbot.bundle", "message_main_attachment_id")
util.remove_field(cr, "runbot.codeowner", "message_main_attachment_id")
util.remove_field(cr, "runbot.dockerfile", "message_main_attachment_id")
util.remove_field(cr, "runbot.host", "message_main_attachment_id")
util.remove_field(cr, "runbot.trigger", "message_main_attachment_id")
util.remove_field(cr, "runbot.remote", "message_main_attachment_id")
util.remove_field(cr, "runbot.repo", "message_main_attachment_id")
util.remove_field(cr, "runbot.team", "message_main_attachment_id")
else:
_logger.error('Missing utils, cannot migrate to 17.0')