跳至内容
菜单
此问题已终结
1 回复
5582 查看

Hi all,

I've got a template that inherits from "account.report_invoice_document" like this:

<template id="report_invoice_document_mymodule" inherit_id="account.report_invoice_document">
<xpath expr="//div[@class='page']" position="replace">
  <div class="page">
..some content...

Now I'd like to access some fields that are not part of that the "account" model but let's say the field "company.name". How do I do that? Just adding

<div t-field="company.name" />

obviously fails.

Any pointers are greatly appreciated.


Cheers!

形象
丢弃
编写者 最佳答案

D'oh! The 'doc' has a reference to the company via 'company_id'. So in the example above, the company name is accessible through

<div t-field="o.company_id.name" />

Cheers!

形象
丢弃
相关帖文 回复 查看 活动
1
2月 19
7632
1
3月 25
1084
3
11月 24
29639
0
11月 24
1344
0
6月 24
1412