コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2384 ビュー

I have Odoo v8

In the list view i want a value(vat) from the partner that is selected in the invoice.

I have tried  <field name="partner_id.vat"/> but that doesn't work.

partner_id is a many to one field.  Vat is a char field.

How can i do that?


アバター
破棄
最善の回答

You can create a related (v7) / related (v8) field for that.

Ex:

# For older version style
_columns = {
'partner_vat': fields.related('partner_id.vat', type='char', string='Vat')
}
# For API version style
partner_vat = fields.Char(related='partner_id.vat', string='Vat')

Add this field in tree view.

Sudhir Arya
ERP Harbor Consulting Services
skype: 
sudhir@erpharbor.com  website: http://www.erpharbor.com
アバター
破棄
著作者 最善の回答

Sorry i am new to this.

Where can i make a related field? 

アバター
破棄

In your custom module, inherit account.invoice object and add the related field as I said in my answer.

著作者

Do i need a custom module for that?

Yes, you will have to create a custom module for that.