From 3891892d9f72c679be96cc3f8ccc0e613daf8da0 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 20 Aug 2014 18:28:57 +0200 Subject: [PATCH] Merge from nse back-end partial picking wizard --- addons/stock/__openerp__.py | 3 +- addons/stock/static/src/css/stock.css | 13 +- addons/stock/static/src/xml/picking.xml | 2 +- addons/stock/stock.py | 27 ++- addons/stock/stock_view.xml | 20 +- addons/stock/wizard/__init__.py | 2 +- addons/stock/wizard/stock_transfer_details.py | 183 ++++++++++++++++++ .../stock/wizard/stock_transfer_details.xml | 49 +++++ 8 files changed, 279 insertions(+), 20 deletions(-) create mode 100644 addons/stock/wizard/stock_transfer_details.py create mode 100644 addons/stock/wizard/stock_transfer_details.xml diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index 6acc6a7bfd0..79bfe2cbfa3 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -75,6 +75,7 @@ Dashboard / Reports for Warehouse Management will include: 'wizard/stock_return_picking_view.xml', 'wizard/make_procurement_view.xml', 'wizard/orderpoint_procurement_view.xml', + 'wizard/stock_transfer_details.xml', 'stock_incoterms.xml', 'stock_report.xml', 'stock_view.xml', @@ -86,7 +87,7 @@ Dashboard / Reports for Warehouse Management will include: 'views/report_package_barcode.xml', 'views/report_lot_barcode.xml', 'views/report_location_barcode.xml', - 'views/report_stockpicking.xml', + 'views/report_stockpicking.xml', 'views/report_stockinventory.xml', 'views/stock.xml', ], diff --git a/addons/stock/static/src/css/stock.css b/addons/stock/static/src/css/stock.css index 6ddf405f114..df62fed2558 100644 --- a/addons/stock/static/src/css/stock.css +++ b/addons/stock/static/src/css/stock.css @@ -106,10 +106,10 @@ } .openerp .oe_stock_scan_image { opacity: 0.2; - margin: 0 5px 0; + margin: 0 5px 0; } .openerp .oe_stock_scan_image:hover { - opacity: 1 + opacity: 1 } .oe_gauge_labels { width: 100%; @@ -120,3 +120,12 @@ display: inline-block; margin: -7px; } + +.oe_stock_scan_image_btn { + /*height : 42px;*/ +} +.oe_stock_scan_button { + border: none !important; + background: none !important; + box-shadow: none !important; +} diff --git a/addons/stock/static/src/xml/picking.xml b/addons/stock/static/src/xml/picking.xml index 05790cebc3a..3f0dfa001a7 100644 --- a/addons/stock/static/src/xml/picking.xml +++ b/addons/stock/static/src/xml/picking.xml @@ -108,7 +108,7 @@

- +

diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4c96986c635..0618a998f03 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1279,6 +1279,21 @@ class stock_picking(osv.osv): stock_move_obj.do_unreserve(cr, uid, move_ids, context=context) stock_move_obj.action_assign(cr, uid, move_ids, context=context) + @api.cr_uid_ids_context + def do_enter_transfer_details(self, cr, uid, picking, context=None): + if not context: + context = {} + + context.update({ + 'active_model': self._name, + 'active_ids': picking, + 'active_id': len(picking) and picking[0] or False + }) + + created_id = self.pool['stock.transfer_details'].create(cr, uid, {'picking_id': len(picking) and picking[0] or False}, context) + return self.pool['stock.transfer_details'].wizard_view(cr, uid, created_id, context) + + @api.cr_uid_ids_context def do_transfer(self, cr, uid, picking_ids, context=None): """ @@ -1298,10 +1313,10 @@ class stock_picking(osv.osv): todo_move_ids = [] if not all_op_processed: todo_move_ids += self._create_extra_moves(cr, uid, picking, context=context) - + picking.refresh() #split move lines eventually - + toassign_move_ids = [] for move in picking.move_lines: remaining_qty = move.remaining_qty @@ -3749,9 +3764,9 @@ class stock_pack_operation(osv.osv): 'product_uom_id': fields.many2one('product.uom', 'Product Unit of Measure'), 'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True), 'qty_done': fields.float('Quantity Processed', digits_compute=dp.get_precision('Product Unit of Measure')), - 'package_id': fields.many2one('stock.quant.package', 'Package'), # 2 + 'package_id': fields.many2one('stock.quant.package', 'Source Package'), # 2 'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number'), - 'result_package_id': fields.many2one('stock.quant.package', 'Container Package', help="If set, the operations are packed into this package", required=False, ondelete='cascade'), + 'result_package_id': fields.many2one('stock.quant.package', 'Destination Package', help="If set, the operations are packed into this package", required=False, ondelete='cascade'), 'date': fields.datetime('Date', required=True), 'owner_id': fields.many2one('res.partner', 'Owner', help="Owner of the quants"), #'update_cost': fields.boolean('Need cost update'), @@ -3759,8 +3774,8 @@ class stock_pack_operation(osv.osv): 'currency': fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed", ondelete='CASCADE'), 'linked_move_operation_ids': fields.one2many('stock.move.operation.link', 'operation_id', string='Linked Moves', readonly=True, help='Moves impacted by this operation for the computation of the remaining quantities'), 'remaining_qty': fields.function(_get_remaining_qty, type='float', string='Remaining Qty'), - 'location_id': fields.many2one('stock.location', 'Location From', required=True), - 'location_dest_id': fields.many2one('stock.location', 'Location To', required=True), + 'location_id': fields.many2one('stock.location', 'Source Location', required=True), + 'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True), 'processed': fields.selection([('true','Yes'), ('false','No')],'Has been processed?', required=True), } diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 3cc31f3ec36..623e17b9d22 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -634,9 +634,7 @@ +

@@ -673,20 +673,22 @@ - + - - + + - + + + @@ -1338,7 +1340,7 @@

- Click to launch the barcode interface @@ -1911,7 +1913,7 @@