對於one2many,將many2one放在其他對象中是很有必要的。在你的情況下,你必須把many2one account.voucher。並檢查是否已將您的字段「customer_payment_lines」保留在視圖中。試試這個,
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<!-- product tree -->
<record id="view_royalfood_customer_payment" model="ir.ui.view">
<field name="name">Royal Food Customer Payment</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_form2" />
<field name="arch" type="xml">
<field name="opening_details_ids" position="after">
<field name="customer_payment_lines">
<tree>
<field name="name"/>
<field name="company_id"/>
<field name="account_id"/>
</tree>
</field>
</field>
</field>
</record>
</data>
</openerp>
希望這能解決你的問題。
yes.i也使用many2one,但這是行不通的。不能顯示帳戶憑證的數據。 –
顯示您的代碼。所以我可以幫助你。 py和xml文件。 – Mansi
在XML ... \t \t \t <! - 產品樹 - > \t \t <記錄id = 「view_royalfood_customer_payment」模型= 「ir.ui.view」> \t \t \t <字段名= 「名」>皇家食品客戶付款 \t \t \t <字段名= 「模型」> account.bank.statement \t \t \t < F ield名稱= 「inherit_id」 REF = 「account.view_bank_statement_form2」/> \t \t \t <字段名= 「拱」 類型= 「XML」> \t \t \t \t <字段名= 「line_ids」 上下文=「{」日期「:日期}」位置= 「後」> \t \t \t \t \t <字段名= 「customer_payment_lines」/> \t \t \t \t \t \t \t \t \t \t –