Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
2924 Ansichten

I have inherited the customer invoice report and would like to conditionally replace the field of the sales order number with a newly created field of a quotation number.  The conditional part is already in the original report as 

so it already replaces the words Order number with Quotation number depending on the doc state, but I also need to conditionally replace the "span t-field="doc.name" bit with "span t-field=doc.quotation_number" if the doc state is in quotation and I'm not sure how to correctly amend the code.  Thanks in advance.

Avatar
Verwerfen
Beste Antwort

To inherit the sale order report as below:



<template id="report_saleorder_document_inherit_quotation_number" inherit_id="sale.report_saleorder_document">


    <xpath expr="//span[@t-field='doc.name']" position="replace">


        <span t-if="doc.state in ['draft','sent']" t-field="doc.quotation_number"/>


        <span t-else="" t-field="doc.name"/>


    </xpath>


</template>




The customer preview has a template which you can inherit and change it separately as below:



 <template id="portal_my_quotations_inhrit"  inherit_id="sale.portal_my_quotations">


    <xpath expr="//t[@t-out='quotation.name']" position="replace">


        <t t-out="quotation.quotation_number"/>


    </xpath>


 </template>



   


        


        


    


To inherit the sale order report as below:




```



   


        


        


    



```




The customer preview has a template which you can inherit and change it separately as below:




```


 

    


        


   


 


```



Avatar
Verwerfen
Autor

Works perfectly, thank you.

Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Nov. 24
4087
2
Juli 23
3439
1
März 23
3244
2
Aug. 24
3835
3
März 24
2348