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
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2012-11-15 12:38:51 +0000
3+++ stock/stock.py 2012-11-19 12:48:30 +0000
4@@ -1393,6 +1393,11 @@
5 """
6 if context is None:
7 context = {}
8+ lang_obj = self.pool.get('res.lang')
9+ user_lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).context_lang
10+ lang_ids = lang_obj.search(cr, uid, [('code','like',user_lang)])
11+ date_format = lang_obj.browse(cr, uid, lang_ids[0], context=context).date_format
12+
13 for pick in self.browse(cr, uid, ids, context=context):
14 msg=''
15 if pick.auto_picking:
16@@ -1404,7 +1409,7 @@
17 }
18 message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or '?') + "' "
19 if pick.min_date:
20- msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime('%m/%d/%Y')
21+ msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime(date_format)
22 state_list = {
23 'confirmed': _('is scheduled %s.') % msg,
24 'assigned': _('is ready to process.'),

Subscribers

People subscribed via source and target branches

to all changes: