Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5585 Widoki

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!

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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!

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lut 19
7632
1
mar 25
1086
3
lis 24
29644
0
lis 24
1345
0
cze 24
1413