title: Inherit field from one model to another model - Odoo v9 Community
body: <p>I'm trying to add a field from a table, into another table, through a module.</p>
  
  <p>Specifically, trying to inherit a field from <code>product.product</code>, the <code>price</code> field, to add it into <code>stock.move</code> model.</p>
  
  <p>So, I've created a model into this new module I'm making.</p>
  
  <p>Like this:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  from openerp import models, fields, api
  import openerp.addons.decimal_precision as dp 
  
  class product(models.Model):
      _inherit = 'product.product'
      _rec_name = 'price_unidad'
  
      price_unidad = fields.One2many('product.product','price', string="Precio", readonly=True)
  
   class StockMove(models.Model):
      _inherit = 'stock.move'
  
      price_unity = fields.Many2one("product", string="Precio", readonly=True)
  </code></pre>
  
  <p>Then, on my views:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; 
  &lt;openerp&gt;
  &lt;data&gt;
  
  &lt;record id="view_stock_move_tree" model="ir.ui.view"&gt;
      &lt;field name="name"&gt;Stock Move Price Tree&lt;/field&gt;
      &lt;field name="model"&gt;stock.move&lt;/field&gt;
      &lt;field name="inherit_id" ref="stock.view_move_picking_tree"/&gt;
      &lt;field name="arch" type="xml"&gt;
          &lt;field name="state" position="before"&gt;
              &lt;field name="price_unity"/&gt;
          &lt;/field&gt;
      &lt;/field&gt; 
  &lt;/record&gt;
  
  &lt;record id="view_stock_move_form" model="ir.ui.view"&gt;
      &lt;field name="name"&gt;Stock Move Price Form&lt;/field&gt;
      &lt;field name="model"&gt;stock.move&lt;/field&gt;
      &lt;field name="inherit_id" ref="stock.view_move_picking_form"/&gt;
      &lt;field name="arch" type="xml"&gt;
          &lt;field name="state" position="before"&gt;
                  &lt;field name="price_unity"/&gt;
              &lt;/field&gt;
      &lt;/field&gt;
  &lt;/record&gt;
  
  &lt;/data&gt;
  &lt;/openerp&gt;
  </code></pre>
  
  <p>I'm not really sure, but it seems like it enters into a neverending loop when I call it from the form view.</p>
  
  <p>So, I don't really know what's wrong with it.</p>
  
  <p>Any ideas on how to accomplish this?</p>
  
  <p>Thanks in advance!</p>