[MIG] document_page_approval: Migration to 17.0

This commit is contained in:
EdgarRetes
2024-10-02 10:40:29 -06:00
committed by Bhavesh Heliconia
parent 49f3835e45
commit a4972a014d
8 changed files with 47 additions and 55 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'")