[FIX]stock: date format in the created log for deliveries and receptions are wrong

bzr revid: mma@tinyerp.com-20121119124318-xkxdzm4htxj0eu7g
This commit is contained in:
Somesh Khare(OpenERP) 2012-11-19 12:43:18 +00:00 committed by Mayur Maheshwari (OpenERP)
parent 66afff1b52
commit f55f248533
1 changed files with 6 additions and 1 deletions

View File

@ -1393,6 +1393,11 @@ class stock_picking(osv.osv):
"""
if context is None:
context = {}
lang_obj = self.pool.get('res.lang')
user_lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).context_lang
lang_ids = lang_obj.search(cr, uid, [('code','like',user_lang)])
date_format = lang_obj.browse(cr, uid, lang_ids[0], context=context).date_format
for pick in self.browse(cr, uid, ids, context=context):
msg=''
if pick.auto_picking:
@ -1404,7 +1409,7 @@ class stock_picking(osv.osv):
}
message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or '?') + "' "
if pick.min_date:
msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime('%m/%d/%Y')
msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime(date_format)
state_list = {
'confirmed': _('is scheduled %s.') % msg,
'assigned': _('is ready to process.'),