تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3254 أدوات العرض

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?

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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 !

الصورة الرمزية
إهمال
أفضل إجابة
<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'

الصورة الرمزية
إهمال