Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2405 มุมมอง

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.