You can use below code to print value from master.
{%- for row in doc.po_details|slice(1) -%}
{% set u = frappe.get_doc(""Warehouse"", row[0].warehouse) %}
<div class=""row"">
<div class=""col-xs-5 text-right""><label><b>Ship To</b></label></div>
<div class=""col-xs-7 ""> {{ u.warehouse_name or '' }} </div>
</div>
<div class=""row"">
<div class=""col-xs-5 text-right""></div>
<div class=""col-xs-7 ""> {{ u.address_line_1 or '' }} </div>
</div>
<div class=""row"">
<div class=""col-xs-5 text-right""></div>
<div class=""col-xs-7 ""> {{ u.address_line_2 or '' }} </div>
</div>
<div class=""row"">
<div class=""col-xs-5 text-right""></div>
<div class=""col-xs-7 ""> {{ u.city or '' }}, {{ u.state or '' }} {{ u.pin or '' }} </div>
</div>
{%- if u.phone_no -%}
<div class=""row"">
<div class=""col-xs-5 text-right""><label><b>Phone:</b></label></div>
<div class=""col-xs-7 ""> {{ u.phone_no or '' }} </div>
</div>
{%- endif -%}
{%- endfor -%}
{%- for row in doc.po_details|slice(1) -%}
{% set u = frappe.get_doc(""Warehouse"", row[0].warehouse) %}
<div class=""row"">
<div class=""col-xs-5 text-right""><label><b>Ship To</b></label></div>
<div class=""col-xs-7 ""> {{ u.warehouse_name or '' }} </div>
</div>
<div class=""row"">
<div class=""col-xs-5 text-right""></div>
<div class=""col-xs-7 ""> {{ u.address_line_1 or '' }} </div>
</div>
<div class=""row"">
<div class=""col-xs-5 text-right""></div>
<div class=""col-xs-7 ""> {{ u.address_line_2 or '' }} </div>
</div>
<div class=""row"">
<div class=""col-xs-5 text-right""></div>
<div class=""col-xs-7 ""> {{ u.city or '' }}, {{ u.state or '' }} {{ u.pin or '' }} </div>
</div>
{%- if u.phone_no -%}
<div class=""row"">
<div class=""col-xs-5 text-right""><label><b>Phone:</b></label></div>
<div class=""col-xs-7 ""> {{ u.phone_no or '' }} </div>
</div>
{%- endif -%}
{%- endfor -%}
No comments:
Post a Comment