title: How to count and sum checked record in tree view and then set this result in form field. Odoo 8
body: <p>I need count and sum the check record from tree view.</p>
  
  <p>I have the tree view:
  <a href="https://i.stack.imgur.com/C0TAE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C0TAE.jpg" alt="Mi tree view"></a></p>
  
  <p>My code is:</p>
  
  <pre class="lang-py prettyprint-override"><code>class summary_bidding_group(models.Model):
      _name = 'summary.bidding.group'
      _description = 'Summary Bidding Group'
  
      check_contract = fields.Boolean("Check Contract", store = 
      True)
      bidding_amount = fields.Float("plan.bidding", related = 
      'bidding_id.amount', store = True)
  
  class plan_group(models.Model):
      _inherit = 'plan.group'
      summary_bidding_group_id = 
      fields.One2many('summary.bidding.group','group_id',store = True)
  
      award_bidding = fields.Integer('award bidding', store = True) 
      total_bidding = fields.Float('total bidding', store = True) 
  </code></pre>