Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2569 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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:




```


 

    


        


   


 


```



Ảnh đại diện
Huỷ bỏ
Tác giả

Works perfectly, thank you.

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 11 24
3712
2
thg 7 23
2874
1
thg 3 23
2875
2
thg 8 24
3265
3
thg 3 24
1809