Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2570 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

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:




```


 

    


        


   


 


```



Аватар
Відмінити
Автор

Works perfectly, thank you.

Related Posts Відповіді Переглядів Дія
3
лист. 24
3713
2
лип. 23
2877
1
бер. 23
2877
2
серп. 24
3265
3
бер. 24
1810