fix: sider issues

This commit is contained in:
Saqib Ansari 2022-03-24 17:56:27 +05:30
parent cf51a0a1b8
commit cb4873c019
2 changed files with 9 additions and 11 deletions

View File

@ -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)

View File

@ -619,15 +619,10 @@ 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(
query = frappe.qb.select(SerialNo.name).from_(SerialNo).where(
(SerialNo.name.isin(serial_nos))
& (Coalesce(SerialNo.delivery_document_type, "") != "")
)
)
result = query.run()
if result and len(result) > 0: