From 86718d98bd77fe4b4285a22f67ad990c46462d17 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 6 Dec 2016 16:14:21 +0100 Subject: [PATCH] [FIX] stock: don't delete package when you would still use Unpack button as it can create problems on pickings, ... --- addons/stock/stock.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7d39758aae3..f9487017fef 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3968,7 +3968,6 @@ class stock_package(osv.osv): context = dict(context or {}, active_ids=ids) return self.pool.get("report").get_action(cr, uid, ids, 'stock.report_package_barcode_small', context=context) - def unpack(self, cr, uid, ids, context=None): quant_obj = self.pool.get('stock.quant') for package in self.browse(cr, uid, ids, context=context): @@ -3976,8 +3975,6 @@ class stock_package(osv.osv): quant_obj.write(cr, SUPERUSER_ID, quant_ids, {'package_id': package.parent_id.id or False}, context=context) children_package_ids = [child_package.id for child_package in package.children_ids] self.write(cr, uid, children_package_ids, {'parent_id': package.parent_id.id or False}, context=context) - #delete current package since it contains nothing anymore - self.unlink(cr, uid, ids, context=context) return self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'stock', 'action_package_view', context=context) def get_content(self, cr, uid, ids, context=None):