mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] Add uninstall_hook
This commit is contained in:
committed by
Patrick Wilson
parent
beb3d83b99
commit
c68d04fedb
@@ -1 +1,2 @@
|
|||||||
from . import models
|
from . import models
|
||||||
|
from .uninstall_hook import uninstall_hook
|
||||||
|
|||||||
@@ -17,4 +17,5 @@
|
|||||||
'views/stock_request_views.xml',
|
'views/stock_request_views.xml',
|
||||||
],
|
],
|
||||||
"installable": True,
|
"installable": True,
|
||||||
|
'uninstall_hook': 'uninstall_hook',
|
||||||
}
|
}
|
||||||
|
|||||||
11
stock_request_submit/uninstall_hook.py
Normal file
11
stock_request_submit/uninstall_hook.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Copyright 2019 Eficent Business and IT Consulting Services, S.L.
|
||||||
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
from odoo import api, SUPERUSER_ID
|
||||||
|
|
||||||
|
|
||||||
|
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'})
|
||||||
Reference in New Issue
Block a user