How to create related field in odoo?
<p>I am trying to create related field for displaying customer's balance in sale orders. I think i am creating wrong related field. Can anybody help me how to create related field in odoo? </p>

<p><strong>here this is related field i am creating</strong></p>

<p><code>customer_balance = fields.Related('partner_id.credit', string='Customer Balance')</code></p>

<p><strong>and other one is</strong></p>

<p><code>customer_balance = fields.Char(related='partner_id.credit', store=True)</code></p>

<p>Try below code. It will work for you.</p>

<pre><code>customer_balance = fields.Float(related="partner_id.credit",string="Balance")
</code></pre>

<p>Thanks..</p>

python openerp field odoo-8