Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
5424 มุมมอง

Hi guys, anyone here can help me in adding my Sales Person name to my invoices?

Currently only the Sales Order # is displayed, which is fine but I need the Sales Person to be displayed too.

I try adding the below code to the qweb view of the 'report_invoice_document' report but I got Odoo Server Error

Code:    <div t-if="doc.user_id.name" class="col-xs-3"> 

             <strong>Salesperson:</strong> 

               <p t-field="doc.user_id"/>  </div>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello, you can try with:

<div t-if="o.user_id" class="col-xs-3"> 

      <strong>Salesperson:</strong> 

      <span t-field="o.user_id.name"/>

</div>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

It should be o.user_id  not doc.user_id because o is variable representing invoice in default odoo.

<div name="user" class="col-xs-2" t-if="o.user_id">
<strong>Sales Person:</strong>
<p t-field="o.user_id"/>
</div>


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,   

Make sure if the object is doc or o
   just try like this :     

 <div name="reference" class="col-auto mw-100 mb-2" t-if="o.user_id">                  

                  <strong>Sales person:</strong>
                   <p class="m-0" t-field="o.user_id"/>

</div>

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks guys, it worked, the 'doc' was definitely the issue.

Thanks a lot everyone, you guys are awesome. 


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Invoicing without delivering แก้ไขแล้ว
1
ก.ค. 21
3999
0
ธ.ค. 15
3346
2
ก.ค. 23
2214
2
มิ.ย. 25
847
1
เม.ย. 25
136