title: How to add values of particular field from One2many field in Odoo
body: <p>I have a One2many field and three fields inside the One2many field 'name','id' and 'price'. I want that all values for 'price' field added from multiple rows of One2many field.</p>
  
  <p>My Python function here:</p>
  
  <pre><code>    @api.onchange('price', 'vals', 'sum')
      def _onchange_amount_weight(self):
      if self.price:
          sum = 0;
          print "s", sum
          self.vals = self.price + self.sum
          print"a", self.vals
          self.sum = self.vals
          print"b", self.sum
          self.sum += self.price
          print"c", self.sum
  </code></pre>
  
  <p>Thanks...</p>