From cb4873c019f7694f64b94b5845e2fa73a602103a Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Thu, 24 Mar 2022 17:56:27 +0530 Subject: [PATCH] fix: sider issues --- .../pos_invoice_merge_log/pos_invoice_merge_log.py | 9 ++++++--- erpnext/stock/doctype/serial_no/serial_no.py | 11 +++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py index d8f893c64487..b3d9c15f086d 100644 --- a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py +++ b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py @@ -318,13 +318,16 @@ def split_invoices(invoices): pos_return_docs = [frappe.get_cached_doc("POS Invoice", d.pos_invoice) for d in invoices if d.is_return and d.return_against] for pos_invoice in pos_return_docs: for item in pos_invoice.items: - if not item.serial_no: continue + if not item.serial_no: + continue return_against_is_added = any(d for d in _invoices if d.pos_invoice == pos_invoice.return_against) - if return_against_is_added: break + if return_against_is_added: + break return_against_is_consolidated = frappe.db.get_value('POS Invoice', pos_invoice.return_against, 'status', cache=True) == 'Consolidated' - if return_against_is_consolidated: break + if return_against_is_consolidated: + break pos_invoice_row = [d for d in invoices if d.pos_invoice == pos_invoice.return_against] _invoices.append(pos_invoice_row) diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 66c770729268..2808c219ea85 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -619,14 +619,9 @@ def get_delivered_serial_nos(serial_nos): SerialNo = frappe.qb.DocType("Serial No") serial_nos = get_serial_nos(serial_nos) - query = ( - frappe.qb - .from_(SerialNo) - .select(SerialNo.name) - .where( - (SerialNo.name.isin(serial_nos)) - & (Coalesce(SerialNo.delivery_document_type, "") != "") - ) + query = frappe.qb.select(SerialNo.name).from_(SerialNo).where( + (SerialNo.name.isin(serial_nos)) + & (Coalesce(SerialNo.delivery_document_type, "") != "") ) result = query.run()