← Back to team overview

openerp-community team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-1116004-dharmang into lp:openobject-addons

 

Dharmang Soni (OpenERP Trainee) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-1116004-dharmang into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1116004 in OpenERP Addons: "[Trunk/7.0] Deliver/Receive products gives a error"
  https://bugs.launchpad.net/openobject-addons/+bug/1116004

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1116004-dharmang/+merge/151420

Deliver/Receive products gives a error (When incomming product shipment is done and trying to Deliver/Receive Products it cause error.)
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1116004-dharmang/+merge/151420
Your team OpenERP Community is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-1116004-dharmang.
=== modified file 'stock/wizard/stock_partial_move.py'
--- stock/wizard/stock_partial_move.py	2012-12-06 15:13:16 +0000
+++ stock/wizard/stock_partial_move.py	2013-03-04 06:46:25 +0000
@@ -21,6 +21,7 @@
 
 from openerp.osv import fields, osv
 from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
+from openerp.tools.translate import _
 import time
 
 class stock_partial_move_line(osv.osv_memory):
@@ -65,6 +66,10 @@
         partial_data = {
             'delivery_date' : partial.date
         }
+        active_id = context.get("active_id",[])
+        stock_move = self.pool.get("stock.move").browse(cr, uid, active_id, context=context)
+        if stock_move.state == "done":
+            raise osv.except_osv(_('Warning!'),_('Shipment was already processed. Unable to perform operation.'))
         moves_ids = []
         for move in partial.move_ids:
             move_id = move.move_id.id