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
=== modified file 'analytic/analytic.py'
--- analytic/analytic.py 2013-06-07 11:38:29 +0000
+++ analytic/analytic.py 2013-07-29 05:24:27 +0000
@@ -320,7 +320,7 @@
320 'name': fields.char('Description', size=256, required=True),320 'name': fields.char('Description', size=256, required=True),
321 'date': fields.date('Date', required=True, select=True),321 'date': fields.date('Date', required=True, select=True),
322 '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')),322 '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')),
323 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),323 'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.', digits_compute=dp.get_precision('Account')),
324 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]),324 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]),
325 'user_id': fields.many2one('res.users', 'User'),325 'user_id': fields.many2one('res.users', 'User'),
326 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),326 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
327327
=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
--- hr_timesheet_invoice/hr_timesheet_invoice.py 2013-07-25 10:04:02 +0000
+++ hr_timesheet_invoice/hr_timesheet_invoice.py 2013-07-29 05:24:27 +0000
@@ -20,6 +20,7 @@
20##############################################################################20##############################################################################
2121
22import time22import time
23from datetime import datetime
2324
24from openerp.osv import fields, osv25from openerp.osv import fields, osv
25from openerp.tools.translate import _26from openerp.tools.translate import _
@@ -274,11 +275,15 @@
274275
275 line_ids = cr.dictfetchall()276 line_ids = cr.dictfetchall()
276 note = []277 note = []
278 lang_obj = self.pool.get('res.lang')
279 user_lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).lang
280 lang_id = lang_obj.search(cr, uid, [('code','like',user_lang)])
281 date_format = lang_obj.browse(cr, uid, lang_id[0], context=context).date_format
277 for line in line_ids:282 for line in line_ids:
278 # set invoice_line_note283 # set invoice_line_note
279 details = []284 details = []
280 if data.get('date', False):285 if data.get('date', False):
281 details.append(line['date'])286 details.append(datetime.strptime(line['date'], '%Y-%m-%d').strftime(date_format))
282 if data.get('time', False):287 if data.get('time', False):
283 if line['product_uom_id']:288 if line['product_uom_id']:
284 details.append("%s %s" % (line['unit_amount'], product_uom_obj.browse(cr, uid, [line['product_uom_id']],context2)[0].name))289 details.append("%s %s" % (line['unit_amount'], product_uom_obj.browse(cr, uid, [line['product_uom_id']],context2)[0].name))