Merge lp:~openerp-dev/openobject-addons/trunk-opw-577601-port-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Merged
Merged at revision: 8298
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-577601-port-mma
Merge into: lp:openobject-addons
Diff against target: 24 lines (+6/-1)
1 file modified
stock/stock.py (+6/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-577601-port-mma
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+134893@code.launchpad.net

Description of the change

Hello

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

Steps to reproduce:
1. Create a user and select user lang(Eg: Dutch).
2. Change the Date format as %d/%m/%Y.
3. Now confirm a sale order or confirm the Reception of PO, Now check the date format of the created logs.

This branch fixes this issue.
Code is forward port from 6.1

Thanks,
Mayur

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock/stock.py'
--- stock/stock.py 2012-11-15 12:38:51 +0000
+++ stock/stock.py 2012-11-19 12:48:30 +0000
@@ -1393,6 +1393,11 @@
1393 """1393 """
1394 if context is None:1394 if context is None:
1395 context = {}1395 context = {}
1396 lang_obj = self.pool.get('res.lang')
1397 user_lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).context_lang
1398 lang_ids = lang_obj.search(cr, uid, [('code','like',user_lang)])
1399 date_format = lang_obj.browse(cr, uid, lang_ids[0], context=context).date_format
1400
1396 for pick in self.browse(cr, uid, ids, context=context):1401 for pick in self.browse(cr, uid, ids, context=context):
1397 msg=''1402 msg=''
1398 if pick.auto_picking:1403 if pick.auto_picking:
@@ -1404,7 +1409,7 @@
1404 }1409 }
1405 message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or '?') + "' "1410 message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or '?') + "' "
1406 if pick.min_date:1411 if pick.min_date:
1407 msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime('%m/%d/%Y')1412 msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime(date_format)
1408 state_list = {1413 state_list = {
1409 'confirmed': _('is scheduled %s.') % msg,1414 'confirmed': _('is scheduled %s.') % msg,
1410 'assigned': _('is ready to process.'),1415 'assigned': _('is ready to process.'),

Subscribers

People subscribed via source and target branches

to all changes: