[MIG] document_page_approval: Migration to 17.0

This commit is contained in:
EdgarRetes
2024-10-02 10:40:29 -06:00
committed by Víctor Martínez
parent b919f6bf72
commit 74660f10b7
9 changed files with 47 additions and 61 deletions

View File

@@ -5,10 +5,10 @@ import logging
_logger = logging.getLogger(__name__)
def post_init_hook(cr, registry): # pragma: no cover
def post_init_hook(env): # pragma: no cover
# Set all pre-existing pages history to approved
_logger.info("Setting history to approved.")
cr.execute(
env.cr.execute(
"""
UPDATE document_page_history
SET state='approved',
@@ -19,7 +19,7 @@ def post_init_hook(cr, registry): # pragma: no cover
)
def uninstall_hook(cr, registry): # pragma: no cover
def uninstall_hook(env): # pragma: no cover
# Remove unapproved pages
_logger.info("Deleting unapproved Change Requests.")
cr.execute("DELETE FROM document_page_history WHERE state != 'approved'")
env.cr.execute("DELETE FROM document_page_history WHERE state != 'approved'")