Serial nos in sales invoice after Serial and Batch bundle update

Earlier item.serial_no was able to fetch all the serial numbers of the item but after implementation of serial and batch bundle it is throwing “none” error in custom print format.
Please help to get serial nos in invoice

Following, because I found that Serial and Batch Bundle feature is also causing issues for me

@Ulter52 @pmjd

The issue has fixed, kindly pull the latest code and check.

If you have the custom print format, then you need to call the get_serial_or_batch_nos method. You can also refer the below code to add Serial / Batch Nos in your print format.

<table class="table table-bordered">
	<tbody>
		<tr>
			<th>Sr</th>
			<th>Item Name</th>
			<th>Serial / Batch No</th>
			<th class="text-right">Qty</th>
			<th class="text-right">Rate</th>
			<th class="text-right">Amount</th>
		</tr>
		{%- for row in doc.items -%}
		<tr>
			<td style="width: 3%;">{{ row.idx }}</td>
			<td style="width: 20%;">
				{{ row.item_name }}
				{% if row.item_code != row.item_name -%}
				<br>Item Code: {{ row.item_code}}
				{%- endif %}
			</td>
			<td style="width: 37%;">
				<div style="border: 0px;">{{ get_serial_or_batch_nos(row.serial_and_batch_bundle) }}</div>
			</td>
			<td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
			<td style="width: 15%; text-align: right;">{{
				row.get_formatted("rate", doc) }}</td>
			<td style="width: 15%; text-align: right;">{{
				row.get_formatted("amount", doc) }}</td>
		</tr>
		{%- endfor -%}
	</tbody>
</table>

You can also override the template of the Serial and Batch Bundle using the Custom APP

Add get_serial_or_batch_nos method in your custom app’s hooks.py file (Check below image)

Screenshot 2023-06-26 at 3 59 21 PM

Write your custom template code for the Serial and Batch Bundle print in the get_serial_or_batch_nos method and check
Screenshot 2023-06-26 at 3 59 52 PM

1 Like

Hi @rohit_w,
function {{ get_serial_or_batch_nos(row.serial_and_batch_bundle) }} worked after updating to latest release.
thanks for the help.