fix: error list index out of range when saving a production plan

fix: error list index out of range when saving a production plan (#36807)
This commit is contained in:
mergify[bot] 2023-08-26 18:13:16 +05:30 committed by GitHub
parent d4218a88ad
commit 740fe95ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@ class ProductionPlan(Document):
data = sales_order_query(filters={"company": self.company, "sales_orders": sales_orders}) data = sales_order_query(filters={"company": self.company, "sales_orders": sales_orders})
title = _("Production Plan Already Submitted") title = _("Production Plan Already Submitted")
if not data: if not data and sales_orders:
msg = _("No items are available in the sales order {0} for production").format(sales_orders[0]) msg = _("No items are available in the sales order {0} for production").format(sales_orders[0])
if len(sales_orders) > 1: if len(sales_orders) > 1:
sales_orders = ", ".join(sales_orders) sales_orders = ", ".join(sales_orders)