title: How to sum other columns when using "Group by" in a Tree View?
body: <p>I have a custom module with three different amount fields for money:</p>
  
  <ul>
  <li><code>Total a pagar</code> is a <code>float</code> field</li>
  <li><code>Total pendiente</code> and <code>Total pagado</code> are calculated from functions</li>
  </ul>
  
  <p>This is how my Tree View looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/tDQMY.png" alt="enter image description here"></p>
  
  <p><br/></p>
  
  <p>When using a group by filter, I want to show the sum of the function fields but only the first one is showing:</p>
  
  <p><img src="https://i.stack.imgur.com/ceWNG.png" alt="enter image description here"> </p>
  
  <p><br/></p>
  
  <p>I tried using <code>sum</code> parameter in the XML record but that's not working.</p>
  
  <p>This is my module:</p>
  
  <pre><code>class res_partner_current_account(osv.osv):
      def _amount_pending_wrapper(self, cr, uid, ids, field_name, arg, context=None):
          """
          Wrapper because of direct method passing as parameter for function fields
          """
          return self._amount_pending(cr, uid, ids, field_name, arg, context=context)
  
      def _amount_pending(self, cr, uid, ids, field_name, arg, context=None):
          cur_obj = self.pool.get('res.currency')
          res = {}
          for current_account in self.browse(cr, uid, ids, context=context):
              res[current_account.id] = {
                  'amount_pending': 0.0,
                  'amount_payed': 0.0,
              }
              cur = current_account.currency_id
              payed = 0.0
              for line in current_account.pay_line:
                  payed += line.amount
              pending = current_account.amount_total - payed
              res[current_account.id]['amount_pending'] = cur_obj.round(cr, uid, cur, pending)
              res[current_account.id]['amount_payed'] = cur_obj.round(cr, uid, cur, payed)
          return res
  
      _name = 'res.partner.current.account'
      _columns = {
          'name': fields.char('Concepto'),
          'order_id': fields.many2one('sale.order', 'Presupuesto', select=True, required=True, ondelete='cascade'),
          'general_account_id': fields.many2one('res.partner.general.account', 'Cuenta general', select=True, required=True, ondelete='cascade'),
          'currency_id': fields.many2one('res.currency', 'Moneda', required=True),
          'amount_total': fields.float('Total a pagar', help='El total de la deuda'),
          'amount_pending': fields.function(_amount_pending_wrapper, digits_compute=dp.get_precision('Account'), string='Total pendiente', multi='sums', help='El importe pendiente por pagar'),
          'amount_payed': fields.function(_amount_pending_wrapper, digits_compute=dp.get_precision('Account'),  string='Total pagado', multi='sums', help='El importe acumulado de pagos'),
          'pay_line': fields.one2many('res.partner.current.account.line', 'current_account_id', 'Líneas de pago',),
          'partner_id': fields.related('general_account_id', 'partner_id', type='many2one', relation='res.partner', string='Contratista', readonly=True, store=True),
          'account_analytic_id': fields.related('general_account_id', 'account_analytic_id', type='many2one', relation='account.analytic.account', string='Proyecto', readonly=True, store=True),
      }
      _defaults = {
          'amount_total': 0.0,
      }
      _rec_name = 'name'
      _order = 'create_date desc'
  
      def create_pay(self, cr, uid, ids, context=None):
          return {
              'name': 'Pagos',
              'view_type': 'form',
              'view_mode': 'form',
              'res_model': 'res.partner.current.account',
              'view_id': False,
              'res_id': ids[0],
              'type': 'ir.actions.act_window',
          }
  </code></pre>