diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index 8e7b5836355..6f2d2a07ca0 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -147,10 +147,6 @@ class stock_move(osv.osv): weight = weight_net = 0.00 if move.product_id.weight > 0.00: converted_qty = move.product_qty - - if move.product_uom.id <> move.product_id.uom_id.id: - converted_qty = uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, move.product_id.uom_id.id) - weight = (converted_qty * move.product_id.weight) if move.product_id.weight_net > 0.00: @@ -165,11 +161,11 @@ class stock_move(osv.osv): _columns = { 'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', store={ - 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20), + 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_uom_qty', 'product_uom'], 30), }), 'weight_net': fields.function(_cal_move_weight, type='float', string='Net weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', store={ - 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20), + 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_uom_qty', 'product_uom'], 30), }), 'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Weight",), } diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 160bd2e0c3d..9240c369a0e 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -383,7 +383,6 @@ - diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 815caeb3bb9..8b7b8a2ebdd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -789,12 +789,12 @@ class stock_picking(osv.osv): * Cancelled: has been cancelled, can't be confirmed anymore""" ), 'priority': fields.function(get_min_max_date, multi="min_max_date", fnct_inv=_set_priority, type='selection', selection=procurement.PROCUREMENT_PRIORITIES, string='Priority', - store={'stock.move': (_get_pickings, ['priority'], 20)}, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, select=1, help="Priority for this picking. Setting manually a value here would set it as priority for all the moves", + store={'stock.move': (_get_pickings, ['priority', 'picking_id'], 20)}, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, select=1, help="Priority for this picking. Setting manually a value here would set it as priority for all the moves", track_visibility='onchange', required=True), 'min_date': fields.function(get_min_max_date, multi="min_max_date", fnct_inv=_set_min_date, - store={'stock.move': (_get_pickings, ['date_expected'], 20)}, type='datetime', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, string='Scheduled Date', select=1, help="Scheduled time for the first part of the shipment to be processed. Setting manually a value here would set it as expected date for all the stock moves.", track_visibility='onchange'), + store={'stock.move': (_get_pickings, ['date_expected', 'picking_id'], 20)}, type='datetime', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, string='Scheduled Date', select=1, help="Scheduled time for the first part of the shipment to be processed. Setting manually a value here would set it as expected date for all the stock moves.", track_visibility='onchange'), 'max_date': fields.function(get_min_max_date, multi="min_max_date", - store={'stock.move': (_get_pickings, ['date_expected'], 20)}, type='datetime', string='Max. Expected Date', select=2, help="Scheduled time for the last part of the shipment to be processed"), + store={'stock.move': (_get_pickings, ['date_expected', 'picking_id'], 20)}, type='datetime', string='Max. Expected Date', select=2, help="Scheduled time for the last part of the shipment to be processed"), 'date': fields.datetime('Creation Date', help="Creation Date, usually the time of the order", select=True, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, track_visibility='onchange'), 'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, copy=False), 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, copy=True), diff --git a/addons/stock_account/stock.py b/addons/stock_account/stock.py index 555ced13758..aecf8d32694 100644 --- a/addons/stock_account/stock.py +++ b/addons/stock_account/stock.py @@ -191,7 +191,7 @@ class stock_picking(osv.osv): pick = self.browse(cr, uid, picking_id, context=context) moves = [x.id for x in pick.move_lines] move_obj= self.pool.get("stock.move") - move_obj.write(cr, uid, moves, {'invoice_state': pick.invoice_state}) + move_obj.write(cr, uid, moves, {'invoice_state': pick.invoice_state}, context=context) _columns = { 'invoice_state': fields.function(__get_invoice_state, type='selection', selection=[