15 lines
477 B
Python
15 lines
477 B
Python
# -*- coding: utf-8 -*-
|
|
from . import models
|
|
from odoo import api, SUPERUSER_ID
|
|
|
|
|
|
def uninstall_hook(cr, registry):
|
|
# 使用cr来执行数据库操作
|
|
with api.Environment.manage():
|
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
|
# 执行数据清理操作
|
|
access_rights = env['access.right'].search([])
|
|
access_rights.unlink()
|
|
followers = env['mail.followers'].search([('res_model', '=', 'access.right')])
|
|
followers.unlink()
|