mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-19 03:42:19 -06:00
[MIG] document_page_approval: Migration to 17.0
This commit is contained in:
committed by
Bhavesh Heliconia
parent
49f3835e45
commit
a4972a014d
@@ -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'")
|
||||
|
||||
Reference in New Issue
Block a user