Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
5442 Widoki

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>

Awatar
Odrzuć
Najlepsza odpowiedź

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>

Awatar
Odrzuć
Najlepsza odpowiedź

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>


Awatar
Odrzuć
Najlepsza odpowiedź

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>

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Thanks a lot everyone, you guys are awesome. 


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 21
4010
0
gru 15
3363
2
lip 23
2220
2
cze 25
853
1
kwi 25
136