Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3274 Visualizzazioni

On report_saleorder_document:


If I use:

<t t-set="o" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
     <span t-field="o.partner_id"/>
</t>

Report displays Azure Interior, Brandon Freeman, both the company and the person's name.


If I use:

<t t-set="o" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
     <span t-field="o.partner_id.name"/>
</t>

Report displays Brandon Freeman, the name of the person


But how do I get the report to display ONLY the client's company name?

Also, is it possible to edit report_saleorder_document using notepad++ or pycharm, instead of odoo's document layout editor? Where is this file stored?

Avatar
Abbandona
Autore Risposta migliore

Found the answer on someone else's question:

<t t-set="o" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
     <span t-field="o.partner_id.parent_id"/>
</t>

Thanks !

Avatar
Abbandona
Risposta migliore
<t t-set="o" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
     <span t-field="o.partner_id.company_name"/>
</t>

Use this. Company name is stored in field 'company_name'

Avatar
Abbandona