2016-03-03 69 views
0

我是做了一份關於account.account模型,但不能訪問account.invoice模型的領域: 我的觀點的XML如下:如何在xml Qweb視圖中從account.invoice模型訪問account.account模型的字段?

<?xml version="1.0"?> 
<t t-name="account.reporte_balance"> 
    <t t-call="report.internal_layout" style="font-size:8px;"> 
     <t t-foreach="docs" t-as="o"> 
     <div class="page"> 
      <div class="oe_structure"/> 
       <div class="row" style="font-size:8px;"> 
        <div class="col-xs-12">..... 

要訪問應該寫另一個模型的領域下列。但沒有獲得account.account專門模型。

**<tr t-foreach="HERE WRITE THE ACCOUNT.ACCOUNT MODEL REL" t-as="o">** 
    <td class="text-center"> 
      <span t-field="o.code"/> 
    </td>...... 

我很感激任何幫助。非常感謝您的寶貴時間。

回答

1

如果發票是發票的列表,你可以這樣做:

<tr t-foreach="invoices" t-as="inv">** 
    <td class="text-center"> 
     <span t-field="inv.account_id.name"/> 
    </td> 
</tr> 

這麼說,我不明白O操作。是在你的代碼...

+0

Odoo顯示我下面的錯誤: QWebException:需要比1點的值更解壓 這是什麼意思? – beriliox

+0

通常涉及一個元組。這似乎與此問題無關,因此您應該創建一個顯示代碼和異常跟蹤的新問題 –