From d78d88cd72bb9260fe00976ae81de3baf20f8337 Mon Sep 17 00:00:00 2001
From: qdp <qdp@tinyerp.com>
Date: Mon, 9 Feb 2009 12:45:21 +0100
Subject: [PATCH] [FIX] unhandled multi selection of entries in wizard
 hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py

lp bug: https://launchpad.net/bugs/327120 fixed

bzr revid: qdp@tinyerp.com-20090209114521-723c5n6yykyde79k
---
 .../wizard/hr_timesheet_invoice_create.py                  | 7 +++++--
 1 file changed, 5 insertions(+), 2 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 85d2c0771cd3..fd5201b62bc8 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -128,7 +128,10 @@ class invoice_create(wizard.interface):
                 #
                 # 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, ','.join(map(str,data['ids'])), product_id, factor_id))
+                str_ids=""
+                for x in data['ids']:
+                    str_ids += ','.join(str(x)) 
+                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, str_ids, product_id, factor_id))
                 line_ids = cr.dictfetchall()
                 note = []
                 for line in line_ids:
@@ -195,7 +198,7 @@ class invoice_create(wizard.interface):
     states = {
         'init' : {
             'actions' : [_get_accounts],
-            'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel'),('create','Create invoices')]},
+            'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel'),('create','Create Invoices')]},
         },
         'create' : {
             'actions' : [],
-- 
GitLab