Skip to Content
Menu
This question has been flagged
5 Replies
3067 Views

Guys,

I would like to remove the Quotation date and Salesperson which is located right side but I can't find where their reference ids.

Where should I get references, I can't find it in report_saleorder_document 

see image https://imgur.com/hUA0yMw


Avatar
Discard
Author

still, all solution can't work, please any help

Best Answer

Hi,

You can actually find these two elements in the report_saleorder_document. You can find the quotation date here and the salesperson here. As they both don't have a really unique identifier it might be easier (and safer) to do an xpath on the above element and just recreate the rest of the content. For example:

<xpath expr="//div[id='informations']" position="replace">
  <div class="row mt32 mb32" id="informations">
    <div t-if="doc.client_order_ref" class="col-auto mw-100 mb-2">
      <strong>Your Reference:</strong>
      <p class="m-0" t-field="doc.client_order_ref"/>
    </div>
    <div t-if="doc.date_order and doc.state not in ['draft','sent']" class="col-auto mw-100 mb-2">
      <strong>Order Date:</strong>
      <p class="m-0" t-field="doc.date_order"/>
    </div>
    <div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto mw-100 mb-2" name="expiration_date">
      <strong>Expiration:</strong>
      <p class="m-0" t-field="doc.validity_date"/>
    </div>
  </div>
</xpath>

Regards,
Yenthe

Avatar
Discard
Best Answer

Hi,

You just need to inherit "report_saleorder_document" in your custom module xml file for remove "Quotation date and Salesperson". You have to select Quotation date and Salesperson using reference.

  • <odoo>
    <data>
    <template id="report_saleorder_document_customized" inherit_id="sale.report_saleorder_document">
              <!-- Hide Quotation date and Salesperson -->
              <!--<xpath expr="//p[@t-field='doc.date_order']" position="replace"/>
                <xpath expr="//p[@t-field='doc.user_id']" position="replace"/>-->
            
                <xpath expr="//div[@class='col-auto mw-100 mb-2'][4]" position="replace"/>
                <xpath expr="//div[@class='col-auto mw-100 mb-2'][3]" position="replace"/>
    </template>
      </data>
    </odoo>

Thanks

Avatar
Discard

Way riskier to do [index] in xpath expressions that to remove a bigger part and rebuild.

Author Best Answer
Hi @Yenthe,

These codes work well for bellow inline Quotation date and Salesperson fields, what I meant those display above one the right side with the same level of customer information.

see images https://imgur.com/hUA0yMw


<xpath expr="//div[@id='informations']" position="replace">
 <div class="row mt32 mb32" id="informations">
 <div t-if="doc.client_order_ref" class="col-auto mw-100 mb-2">                        
<strong>Your Reference:</strong>
 <p class="m-0" t-field="doc.client_order_ref"/>
 </div>                        
<div t-if="doc.date_order and doc.state not in ['draft','sent']" class="col-auto mw-100 mb-2"> 
 <strong>Order Date:</strong>                        
<p class="m-0" t-field="doc.date_order"/>                        
</div>                        
<div t-if="doc.validity_date and doc.state in ['draft', 'sent']" 
class="col-auto mw-100 mb-2" name="expiration_date">                        
<strong>Expiration:</strong>                        
<p class="m-0" t-field="doc.validity_date"/>                        
</div>                    
</div>                
</xpath> 
Thanks
Avatar
Discard

There is something you should try by your self from the given example and if you face issue, just post your code and the issue. We will sure try to help you.

Author

Hi Sudhir,

I already used these code but I don't get the correct one to remove these fields thanks

Related Posts Replies Views Activity
0
Mar 15
2846
0
Feb 24
433
0
Jan 24
403
2
Feb 24
12633
4
Apr 24
17764