summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2009-12-01 12:23:16 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2009-12-01 12:23:16 +0530
commit162c3e320db78f7d2e7b38fbaa36d565ed111b8a (patch)
tree0ea6cbf83ed1cfd6ecfc10f771e302080944147b
parent8c349adead71e10a6b8df173d1b291081b8f982e (diff)
[FIX] Stock/MRP : Track line wizard improved
lp bug: https://launchpad.net/bugs/488869 fixed bzr revid: jvo@tinyerp.com-20091201065316-k1tgyj1vn5mr2hbi
-rw-r--r--addons/mrp/wizard/wizard_track_line.py9
-rw-r--r--addons/stock/wizard/wizard_track_line.py9
2 files changed, 16 insertions, 2 deletions
diff --git a/addons/mrp/wizard/wizard_track_line.py b/addons/mrp/wizard/wizard_track_line.py
index 26236c55e13..0866212549a 100644
--- a/addons/mrp/wizard/wizard_track_line.py
+++ b/addons/mrp/wizard/wizard_track_line.py
@@ -48,6 +48,13 @@ fields = {
}
}
+def _check_picking(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ move_obj = pool.get('stock.move').browse(cr, uid, data['id'])
+ if not move_obj.picking_id:
+ raise wizard.except_wizard(_('Caution!'), _('Before splitting the production lots,make sure this move has a Picking attached !\nYou must save the move before performing this operation.'))
+ return data['form']
+
def _track_lines(self, cr, uid, data, context):
move_id = data['id']
@@ -115,7 +122,7 @@ def _track_lines(self, cr, uid, data, context):
class wizard_track_move(wizard.interface):
states = {
'init': {
- 'actions': [],
+ 'actions': [_check_picking],
'result': {'type': 'form', 'arch': track_form, 'fields': fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('track', 'Ok', 'gtk-ok')]},
},
'track': {
diff --git a/addons/stock/wizard/wizard_track_line.py b/addons/stock/wizard/wizard_track_line.py
index 79c105b962b..9576a9cb2f0 100644
--- a/addons/stock/wizard/wizard_track_line.py
+++ b/addons/stock/wizard/wizard_track_line.py
@@ -48,6 +48,13 @@ fields = {
}
}
+def _check_picking(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ move_obj = pool.get('stock.move').browse(cr, uid, data['id'])
+ if not move_obj.picking_id:
+ raise wizard.except_wizard(_('Caution!'), _('Before splitting the production lots,make sure this move has a Picking attached !\nYou must save the move before performing this operation.'))
+ return data['form']
+
def _track_lines(self, cr, uid, data, context):
move_id = data['id']
@@ -116,7 +123,7 @@ def _track_lines(self, cr, uid, data, context):
class wizard_track_move(wizard.interface):
states = {
'init': {
- 'actions': [],
+ 'actions': [_check_picking],
'result': {'type': 'form', 'arch': track_form, 'fields': fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('track', 'Ok', 'gtk-ok')]},
},
'track': {