8848digital / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
0 stars 0 forks source link

While Creating Dunning from Sales Invoice showing error #296

Open rushabhmaywade opened 6 hours ago

rushabhmaywade commented 6 hours ago

Information about bug

image image

Module

accounts

Version

ERPNext: v15.34.0 (pre-prod)

Frappe Framework: v15.41.0 (pre-prod)

Installation method

None

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
    "erpnext": "15.34.0",
    "frappe": "15.41.0",
    "payments": "0.0.1"
}

Route

Form/Sales Invoice/ACC-SINV-2024-31387

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1775, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/model/mapper.py", line 36, in make_mapped_doc
    return method(source_name)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py", line 2701, in create_dunning
    return get_mapped_doc(
  File "apps/frappe/frappe/model/mapper.py", line 155, in get_mapped_doc
    postprocess(source_doc, target_doc)
  File "apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py", line 2697, in postprocess_dunning
    target.overdue_payments[0].outstanding = source.get("outstanding_amount")
IndexError: list index out of range

Request Data

{
    "type": "POST",
    "args": {
        "method": "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_dunning",
        "source_name": "ACC-SINV-2024-31906",
        "args": null,
        "selected_children": "{}"
    },
    "freeze": true,
    "freeze_message": "",
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.model.mapper.make_mapped_doc",
    "request_id": null
}

Response Data

{
    "exception": "IndexError: list index out of range",
    "exc_type": "IndexError",
    "_exc_source": "erpnext (app)"
}
shubham-DT commented 4 hours ago

Issue Resolved PR 299

tinadn commented 2 hours ago

There is still issue for list index out of range image

shubham-DT commented 2 hours ago

i'll check