~openerp-community/openobject-addons/taktik

« back to all changes in this revision

Viewing changes to hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py

  • Committer: Fabien Lydoire
  • Date: 2010-06-11 12:31:27 UTC
  • Revision ID: fl@taktik.be-20100611123127-x9qxtd50499af3n4
fixed sql update: use the orm

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
 
163
163
                curr_line['note'] = "\n".join(map(lambda x: x or '',note))
164
164
                pool.get('account.invoice.line').create(cr, uid, curr_line)
165
 
                strids = ','.join(map(str, data['ids']))
166
 
                cr.execute("update account_analytic_line set invoice_id=%%s WHERE account_id = %%s and id IN (%s)" % strids, (last_invoice,account.id,))
 
165
                
 
166
                        #strids = ','.join(map(str, data['ids']))
 
167
            #cr.execute("update account_analytic_line set invoice_id=%%s WHERE account_id = %%s and id IN (%s)" % strids, (last_invoice,account.id,))
 
168
            
 
169
            #Get lines with correct account id
 
170
            analytic_line_obj = pool.get('account.analytic.line')
 
171
            line_ids = analytic_line_obj.search(cr,uid,[('account_id','=',account.id),('id','in',data['ids'])])
 
172
            analytic_line_obj.write(cr,uid,line_ids,{'invoice_id':last_invoice})
 
173
                
167
174
                
168
175
        pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
169
176