[FIX] procurement_mrp_no_confirm: Restore workflow at module uninstallation. Fixes #1002

This commit is contained in:
Pedro M. Baeza
2015-09-20 22:58:48 +02:00
committed by Andhitia Rama
parent db6f59a526
commit 27b58d2f44
3 changed files with 17 additions and 0 deletions

View File

@@ -3,3 +3,10 @@ Don't confirm MOs when procured
This module prevents the automatic confirmation of manufacturing order when
procurement orders are executed.
Known issues / Roadmap
======================
* If the production order workflow has been altered in the transition
*prod_trans_draft_picking* to have another condition, when uninstalling this
module, you will need to restore the custom condition.

View File

@@ -17,3 +17,12 @@
##############################################################################
from . import models
from openerp import SUPERUSER_ID, api
def uninstall_hook(cr, registry):
"""Restore workflow condition."""
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
transition = env.ref('mrp.prod_trans_draft_picking')
transition.condition = True

View File

@@ -28,4 +28,5 @@
'demo': [],
'installable': True,
'auto_install': False,
'uninstall_hook': 'uninstall_hook',
}