diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index 6f2d2a07ca0..7bfd52df420 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -56,13 +56,13 @@ class stock_picking(osv.osv): 'volume': fields.float('Volume'), 'weight': fields.function(_cal_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', store={ - 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), - 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), + 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 40), + 'stock.move': (_get_picking_line, ['picking_id', 'product_id','product_uom_qty','product_uom'], 40), }), 'weight_net': fields.function(_cal_weight, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', store={ - 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), - 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), + 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 40), + 'stock.move': (_get_picking_line, ['picking_id', 'product_id','product_uom_qty','product_uom'], 40), }), 'carrier_tracking_ref': fields.char('Carrier Tracking Ref'), 'number_of_packages': fields.integer('Number of Packages'), diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 482f31b22eb..4dd3f47776d 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -113,6 +113,9 @@ + + + @@ -704,6 +707,7 @@ + @@ -712,6 +716,20 @@ + + product.packaging.tree.view.product + product.packaging + + + + + + + + + + + product.packaging.form.view product.packaging @@ -737,6 +755,29 @@ + + product.packaging.form.view.without.product + product.packaging + +
+ + + + + + + + + + + + + + +
+
+
+ product.supplierinfo.form.view product.supplierinfo diff --git a/addons/sale_stock/sale_stock_view.xml b/addons/sale_stock/sale_stock_view.xml index b754a8d0c7f..0d5223a03c8 100644 --- a/addons/sale_stock/sale_stock_view.xml +++ b/addons/sale_stock/sale_stock_view.xml @@ -64,7 +64,7 @@ - + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 83b7977cc4b..973136c1ed7 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2243,7 +2243,7 @@ class stock_move(osv.osv): self.write(cr, uid, [move.id], vals, context=context) def action_done(self, cr, uid, ids, context=None): - """ Process completly the moves given as ids and if all moves are done, it will finish the picking. + """ Process completely the moves given as ids and if all moves are done, it will finish the picking. """ context = context or {} picking_obj = self.pool.get("stock.picking") @@ -2294,6 +2294,7 @@ class stock_move(osv.osv): self.pool.get('stock.quant.package').write(cr, SUPERUSER_ID, [ops.package_id.id], {'parent_id': ops.result_package_id.id}, context=context) move_qty[move.id] -= record.qty #Check for remaining qtys and unreserve/check move_dest_id in + move_dest_ids = set() for move in self.browse(cr, uid, ids, context=context): if move_qty[move.id] > 0: # (=In case no pack operations in picking) main_domain = [('qty', '>', 0)] @@ -2306,23 +2307,23 @@ class stock_move(osv.osv): quants = quant_obj.quants_get_prefered_domain(cr, uid, move.location_id, move.product_id, qty, domain=main_domain, prefered_domain_list=prefered_domain_list, restrict_lot_id=move.restrict_lot_id.id, restrict_partner_id=move.restrict_partner_id.id, context=context) quant_obj.quants_move(cr, uid, quants, move, move.location_dest_id, lot_id=move.restrict_lot_id.id, owner_id=move.restrict_partner_id.id, context=context) - #Check moves that were pushed - if move.move_dest_id.state in ('waiting', 'confirmed'): - other_upstream_move_ids = self.search(cr, uid, [('id', 'not in', ids), ('state', 'not in', ['done', 'cancel']), - ('move_dest_id', '=', move.move_dest_id.id)], context=context) - #If no other moves for the move that got pushed: - if not other_upstream_move_ids and move.move_dest_id.state in ('waiting', 'confirmed'): - self.action_assign(cr, uid, [move.move_dest_id.id], context=context) + # If the move has a destination, add it to the list to reserve + if move.move_dest_id and move.move_dest_id.state in ('waiting', 'confirmed'): + move_dest_ids.add(move.move_dest_id.id) + if move.procurement_id: procurement_ids.append(move.procurement_id.id) - #unreserve the quants and make them available for other operations/moves - quant_obj.quants_unreserve(cr, uid, move, context=context) + #unreserve the quants and make them available for other operations/moves + quant_obj.quants_unreserve(cr, uid, move, context=context) # Check the packages have been placed in the correct locations self._check_package_from_moves(cr, uid, ids, context=context) #set the move as done self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context) self.pool.get('procurement.order').check(cr, uid, procurement_ids, context=context) + #assign destination moves + if move_dest_ids: + self.action_assign(cr, uid, list(move_dest_ids), context=context) #check picking state to set the date_done is needed done_picking = [] for picking in picking_obj.browse(cr, uid, list(pickings), context=context):