From a792608e875d5e543912615f6bc6b2fb3ffa9fc5 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 4 Sep 2013 10:31:18 +0200 Subject: [PATCH] [FIX]scrap: wizard default qty set to zero and remove constraint introduce in revid:qdp-launchpad@openerp.com-20130319125216-pdfo2i9jx5mcea2l + add label/cosmetic in picking view bzr revid: csn@openerp.com-20130904083118-1scykl2z960zmyla --- addons/stock/stock.py | 5 +++-- addons/stock/stock_view.xml | 3 ++- addons/stock/wizard/stock_move.py | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 380df7844c7..93f0e651420 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1554,9 +1554,10 @@ class stock_move(osv.osv): source_location = move.location_id if move.state == 'done': source_location = move.location_dest_id - if source_location.usage != 'internal': + #Previously used to prevent scraping from virtual location but not necessary anymore + #if source_location.usage != 'internal': #restrict to scrap from a virtual location because it's meaningless and it may introduce errors in stock ('creating' new products from nowhere) - raise osv.except_osv(_('Error!'), _('Forbidden operation: it is not allowed to scrap products from a virtual location.')) + #raise osv.except_osv(_('Error!'), _('Forbidden operation: it is not allowed to scrap products from a virtual location.')) move_qty = move.product_qty uos_qty = quantity / move_qty * move.product_uos_qty default_val = { diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 0eca4f6f65b..fa723d283a9 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -595,7 +595,6 @@ - @@ -618,6 +617,7 @@ + @@ -625,6 +625,7 @@ + diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py index 6e2c9a5db71..4abefce8b6a 100644 --- a/addons/stock/wizard/stock_move.py +++ b/addons/stock/wizard/stock_move.py @@ -109,8 +109,6 @@ class stock_move_scrap(osv.osv_memory): res.update({'product_id': move.product_id.id}) if 'product_uom' in fields: res.update({'product_uom': move.product_uom.id}) - if 'product_qty' in fields: - res.update({'product_qty': move.product_qty}) if 'location_id' in fields: if scrap_location_id: res.update({'location_id': scrap_location_id[0]})