Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
3252 Vues

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
Ignorer
Auteur Meilleure réponse

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
Ignorer
Meilleure réponse
<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
Ignorer