Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
5641 Переглядів

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!

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
Odoo12 Model not found Вирішено
1
лют. 19
7673
1
бер. 25
1168
3
лист. 24
29821
0
лист. 24
1409
0
черв. 24
1483