From: Denis Ledoux Date: Tue, 28 Oct 2014 12:40:17 +0000 (+0100) Subject: [MERGE] forward port of branch 7.0 up to 00ec786 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=a6024a6376160a78017e3de94100aa8c95bd41a5;p=odoo%2Fodoo.git [MERGE] forward port of branch 7.0 up to 00ec786 --- a6024a6376160a78017e3de94100aa8c95bd41a5 diff --cc addons/account/account_invoice.py index 44d70dc,f324a07..79fa7a4 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@@ -354,9 -353,12 +354,12 @@@ class account_invoice(osv.osv) context = {} if context.get('active_model', '') in ['res.partner'] and context.get('active_ids', False) and context['active_ids']: - partner = self.pool.get(context['active_model']).read(cr, uid, context['active_ids'], ['supplier','customer'])[0] + partner = self.pool[context['active_model']].read(cr, uid, context['active_ids'], ['supplier','customer'])[0] if not view_type: - view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')]) + try: + view_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'invoice_tree')[1] + except ValueError: + view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')], limit=1) view_type = 'tree' if view_type == 'form': if partner['supplier'] and not partner['customer']: diff --cc addons/hr_timesheet_invoice/report/account_analytic_profit.py index bfaf585,dfdce39..d9fb879 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.py +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.py @@@ -36,8 -37,10 +36,10 @@@ class account_analytic_profit(report_sx return user_obj.browse(self.cr, self.uid, ids) def _journal_ids(self, form, user_id): + if isinstance(user_id, (int, long)): + user_id = [user_id] - line_obj=pooler.get_pool(self.cr.dbname).get('account.analytic.line') - journal_obj=pooler.get_pool(self.cr.dbname).get('account.analytic.journal') + line_obj = self.pool['account.analytic.line'] + journal_obj = self.pool['account.analytic.journal'] line_ids=line_obj.search(self.cr, self.uid, [ ('date', '>=', form['date_from']), ('date', '<=', form['date_to']),