diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index b1f552b64cc..a7973a40a47 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -641,7 +641,7 @@ class purchase_order(osv.osv): 'product_uom': order_line.product_uom.id, 'product_uos': order_line.product_uom.id, 'date': self.date_to_datetime(cr, uid, order.date_order, context), - 'date_expected': self.date_to_datetime(cr, uid, order.date_order, context), + 'date_expected': self.date_to_datetime(cr, uid, order_line.date_planned, context), 'location_id': order.partner_id.property_stock_supplier.id, 'location_dest_id': order.location_id.id, 'picking_id': picking_id, diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 6d9cb1aae84..fca3d9ff073 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -29,7 +29,7 @@ from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp import netsvc from openerp import tools -from openerp.tools import float_compare +from openerp.tools import float_compare, DEFAULT_SERVER_DATETIME_FORMAT import openerp.addons.decimal_precision as dp import logging _logger = logging.getLogger(__name__) @@ -651,7 +651,7 @@ class stock_picking(osv.osv): ), 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date", store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"), - 'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), + 'date': fields.datetime('Creation Date', help="Creation date, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", store=True, type='datetime', string='Max. Expected Date', select=2), @@ -2334,7 +2334,6 @@ class stock_move(osv.osv): 'line_id': move_lines, 'ref': move.picking_id and move.picking_id.name}) - def action_done(self, cr, uid, ids, context=None): """ Makes the move done and if all moves are done, it will finish the picking. @return: @@ -2380,7 +2379,7 @@ class stock_move(osv.osv): if todo: self.action_confirm(cr, uid, todo, context=context) - self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) + self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context) for id in move_ids: wf_service.trg_trigger(uid, 'stock.move', id, cr) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 83362ab5d6f..3c3967e2e2e 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1252,8 +1252,8 @@ - - + +