[FIX] Stock : Unlink() of Move corrected

bzr revid: gpa@tinyerp.com-20100512122204-m1vws90u9apxpzn7
This commit is contained in:
gpa 2010-05-12 17:52:04 +05:30
parent 1c2b3fad8a
commit f93cca1e7e
1 changed files with 2 additions and 0 deletions

View File

@ -1621,6 +1621,8 @@ class stock_move(osv.osv):
return True
def unlink(self, cr, uid, ids, context=None):
if context is None:
context = {}
for move in self.browse(cr, uid, ids, context=context):
if move.state != 'draft':
raise osv.except_osv(_('UserError'),