Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Jinja2 template for rendering PO lines as a CSV file on
"Po number","Ship to Name","Ship to address","Ship to phone number","Product name","Our SKU","Your SKU","Quantity","Amount"
{% for record in records -%}
{% for line in record.lines %}"{{ [
line.purchase.customer and,
line.purchase.customer and line.purchase.delivery_address.full_address.replace('\r\n', ','),
line.purchase.customer and,
line.supplier_product_name or line.description,
line.product and line.product.code,
line.supplier_product_code or '',
]|join('","') }}"
{% endfor %}
{%- endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment