From c8a8f3c78d4d773a8ab3a3d752edcfc73400b21f Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 2 Jun 2014 18:20:18 +0200 Subject: [PATCH] [IMP] FEFO takes FIFO if no lot, location_id and dest_id by default for pack op --- addons/product_expiry/product_expiry.py | 2 +- addons/stock/stock.py | 6 +++++- addons/stock/views/report_location_barcode.xml | 11 ++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py index e311356dbbd..6979344bbcc 100644 --- a/addons/product_expiry/product_expiry.py +++ b/addons/product_expiry/product_expiry.py @@ -92,7 +92,7 @@ class stock_quant(osv.osv): def apply_removal_strategy(self, cr, uid, location, product, qty, domain, removal_strategy, context=None): if removal_strategy == 'fefo': - order = 'removal_date, id' + order = 'removal_date, in_date, id' return self._quants_get_order(cr, uid, location, product, qty, domain, order, context=context) return super(stock_quant, self).apply_removal_strategy(cr, uid, location, product, qty, domain, removal_strategy, context=context) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 71512f633d0..aae9676a8a3 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3871,11 +3871,15 @@ class stock_pack_operation(osv.osv): self.write(cr, uid, [operation_id], {'qty_done': qty}, context=context) else: #no existing operation found for the given domain and picking => create a new one + picking_obj = self.pool.get("stock.picking") + picking = picking_obj.browse(cr, uid, picking_id, context=context) values = { 'picking_id': picking_id, 'product_qty': 0, + 'location_id': picking.location_id.id, + 'location_dest_id': picking.location_dest_id.id, 'qty_done': 1, - } + } for key in domain: var_name, dummy, value = key uom_id = False diff --git a/addons/stock/views/report_location_barcode.xml b/addons/stock/views/report_location_barcode.xml index d9065e0d207..7e6466ed5c8 100644 --- a/addons/stock/views/report_location_barcode.xml +++ b/addons/stock/views/report_location_barcode.xml @@ -7,18 +7,15 @@
-
-
- -
-
-

-

+

+ + +