forked from OCA/server-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.py
19 lines (17 loc) · 931 Bytes
/
hooks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
def uninstall_hook(cr, registry):
"""Revert table tier_review back to original before this module"""
cr.execute(
"update tier_review a set sequence = "
"(select floor(sequence) from tier_review b where a.id = b.id);"
)
cr.execute(
"update tier_review a set status = 'approved' where status = 'forwarded';"
)
cr.execute("alter table tier_review drop column name cascade;")
cr.execute("alter table tier_review drop column review_type cascade;")
cr.execute("alter table tier_review drop column reviewer_id cascade;")
cr.execute("alter table tier_review drop column reviewer_group_id cascade;")
cr.execute("alter table tier_review drop column has_comment cascade;")
cr.execute("alter table tier_review drop column approve_sequence cascade;")