[14.0][MIG] stock_request_submit (Version 13.0 to 14.0)

[MIG] Prettier

[MIG] Rename uninstall_hook.py to hooks.py

[MIG] Added Uninstall Hook Test

[IMP] Black
This commit is contained in:
Patrick Wilson
2021-05-13 15:52:37 -06:00
parent 9f92167b65
commit e69e85f57d
9 changed files with 41 additions and 27 deletions

View File

@@ -0,0 +1,11 @@
# Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api
def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
sr = env["stock.request"].search([("state", "=", "submitted")])
sr.write({"state": "draft"})
sro = env["stock.request.order"].search([("state", "=", "submitted")])
sro.write({"state": "draft"})