I created a sales order using items from my quotation (e.g. AA001). How can I print the quotation ID (AA001) in the sales order?
I saw a previous post addressing printing sales order number in the sales invoice using {{ doc.items[0].sales_order }}. How do i do it for quotation to sales order?
Hi @Joanne_yz
You can use the same approach as {{ doc.items[0].prevdoc_docname }} , but please be aware that this will only retrieve the value from the first row of the items table. There is a possibility of adding different quotations directly to the sales order using the Get Items From button.
If you want to get multiple id then please apply it.
{% set quotation_ids = [] %}
{% for item in doc.items %}
{% if item.prevdoc_docname not in quotation_ids %}
{{ item.prevdoc_docname }}
{% set _ = quotation_ids.append(item.prevdoc_docname) %}
{% endif %}
{% endfor %}