[MERGE] forward port of branch 7.0 up to 00ec786
authorDenis Ledoux <dle@odoo.com>
Tue, 28 Oct 2014 12:40:17 +0000 (13:40 +0100)
committerDenis Ledoux <dle@odoo.com>
Tue, 28 Oct 2014 12:40:17 +0000 (13:40 +0100)
1  2 
addons/account/account_invoice.py
addons/hr_timesheet_invoice/report/account_analytic_profit.py
addons/product_visible_discount/product_visible_discount.py
addons/sale_margin/sale_margin.py
addons/stock/wizard/stock_partial_picking_view.xml

@@@ -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']:
@@@ -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']),
Simple merge