Merge lp:~openerp-dev/openobject-addons/7.0-opw-594962-fka into lp:openobject-addons/7.0

Proposed by Foram Katharotiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-594962-fka
Merge into: lp:openobject-addons/7.0
Diff against target: 41 lines (+7/-2)
2 files modified
analytic/analytic.py (+1/-1)
hr_timesheet_invoice/hr_timesheet_invoice.py (+6/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-594962-fka
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+177315@code.launchpad.net

Description of the change

Hello,

When we create invoice of contract, fixed following two issue of description field.
 - The date format change into DD-MM-YYYY from YY-MM-DD (depends on date formate).
 - made all hours rounded properly in the created text.

Thanks,
FKA

To post a comment you must log in.

Unmerged revisions

9301. By Foram Katharotiya (OpenERP)

[MERGE] with 7.0

9300. By Foram Katharotiya (OpenERP)

[IMP] change date formate

9299. By Foram Katharotiya (OpenERP)

[IMP]change date format and display hours in rounded value when create invoice of contract

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'analytic/analytic.py'
2--- analytic/analytic.py 2013-06-07 11:38:29 +0000
3+++ analytic/analytic.py 2013-07-29 05:24:27 +0000
4@@ -320,7 +320,7 @@
5 'name': fields.char('Description', size=256, required=True),
6 'date': fields.date('Date', required=True, select=True),
7 'amount': fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')),
8- 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
9+ 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.', digits_compute=dp.get_precision('Account')),
10 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]),
11 'user_id': fields.many2one('res.users', 'User'),
12 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
13
14=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
15--- hr_timesheet_invoice/hr_timesheet_invoice.py 2013-07-25 10:04:02 +0000
16+++ hr_timesheet_invoice/hr_timesheet_invoice.py 2013-07-29 05:24:27 +0000
17@@ -20,6 +20,7 @@
18 ##############################################################################
19
20 import time
21+from datetime import datetime
22
23 from openerp.osv import fields, osv
24 from openerp.tools.translate import _
25@@ -274,11 +275,15 @@
26
27 line_ids = cr.dictfetchall()
28 note = []
29+ lang_obj = self.pool.get('res.lang')
30+ user_lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).lang
31+ lang_id = lang_obj.search(cr, uid, [('code','like',user_lang)])
32+ date_format = lang_obj.browse(cr, uid, lang_id[0], context=context).date_format
33 for line in line_ids:
34 # set invoice_line_note
35 details = []
36 if data.get('date', False):
37- details.append(line['date'])
38+ details.append(datetime.strptime(line['date'], '%Y-%m-%d').strftime(date_format))
39 if data.get('time', False):
40 if line['product_uom_id']:
41 details.append("%s %s" % (line['unit_amount'], product_uom_obj.browse(cr, uid, [line['product_uom_id']],context2)[0].name))