From f46f7a770b2d814434573b77e25d0d05332000c7 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 1 Jul 2010 21:35:16 +0530 Subject: [PATCH] [FIX] Hr_timesheet_invoice : Corrected order or notes and uom i18n for invoice of analytic entries bzr revid: jvo@tinyerp.com-20100701160516-0q042murztf74dwt --- .../wizard/hr_timesheet_invoice_create.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index e619df22683..a5b2e35622c 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -109,7 +109,7 @@ class hr_timesheet_invoice_create(osv.osv_memory): last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice) invoices.append(last_invoice) - context2=context.copy() + context2 = context.copy() context2['lang'] = partner.lang cr.execute("SELECT product_id, to_invoice, sum(unit_amount) " \ "FROM account_analytic_line as line " \ @@ -158,7 +158,7 @@ class hr_timesheet_invoice_create(osv.osv_memory): # # Compute for lines # - cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN %s AND product_id=%s and to_invoice=%s", (account.id, tuple(data['ids']), product_id, factor_id)) + cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id IN %s AND product_id=%s and to_invoice=%s ORDER BY account_analytic_line.date", (account.id, tuple(data['ids']), product_id, factor_id)) line_ids = cr.dictfetchall() note = [] @@ -169,7 +169,7 @@ class hr_timesheet_invoice_create(osv.osv_memory): details.append(line['date']) if data['time']: if line['product_uom_id']: - details.append("%s %s" % (line['unit_amount'], self.pool.get('product.uom').browse(cr, uid, [line['product_uom_id']])[0].name)) + details.append("%s %s" % (line['unit_amount'], self.pool.get('product.uom').browse(cr, uid, [line['product_uom_id']],context2)[0].name)) else: details.append("%s" % (line['unit_amount'], )) if data['name']: