alyf-de / banking

An Open Banking Integration with ERPNext
GNU General Public License v3.0
39 stars 20 forks source link

Selecting "Expense Claim" on Reconcilation throws Attribute error #108

Open ashuio opened 1 week ago

ashuio commented 1 week ago

Selecting To include Expense Claims while reconciling throws Attribute error

AttributeError: 'NoneType' object has no attribute 'amount'
Possible source of error: banking (app)

Full error

App Versions

{
    "banking": "15.5.0",
    "erpnext": "15.35.1",
    "frappe": "15.40.6",
    "hrms": "15.28.3",
    "india_compliance": "15.13.2",
    "payments": "0.0.1",
    "print_designer": "1.4.2"
}

Route

Form/Bank Reconciliation Tool Beta/Bank Reconciliation Tool Beta

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/banking/banking/klarna_kosma_integration/doctype/bank_reconciliation_tool_beta/bank_reconciliation_tool_beta.py", line 381, in get_linked_payments
    matching = check_matching(
               ^^^^^^^^^^^^^^^
  File "apps/banking/banking/klarna_kosma_integration/doctype/bank_reconciliation_tool_beta/bank_reconciliation_tool_beta.py", line 425, in check_matching
    subquery = get_queries(
               ^^^^^^^^^^^^
  File "apps/banking/banking/klarna_kosma_integration/doctype/bank_reconciliation_tool_beta/bank_reconciliation_tool_beta.py", line 489, in get_queries
    frappe.get_attr(method_name)(
  File "apps/hrms/hrms/hr/utils.py", line 739, in get_matching_queries
    ec_amount_matching = get_ec_matching_query(
                         ^^^^^^^^^^^^^^^^^^^^^^
  File "apps/hrms/hrms/hr/utils.py", line 769, in get_ec_matching_query
    filters.append(ec.total_sanctioned_amount.gt(common_filters.amount))
                                                 ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'amount'

Request Data

{
    "type": "POST",
    "args": {
        "bank_transaction_name": "ACC-BTN-2024-00028",
        "document_types": "[\"purchase_invoice\",\"sales_invoice\",\"expense_claim\",\"unpaid_invoices\"]",
        "from_date": "2024-04-01",
        "to_date": "2024-09-15",
        "filter_by_reference_date": 0
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/banking.klarna_kosma_integration.doctype.bank_reconciliation_tool_beta.bank_reconciliation_tool_beta.get_linked_payments",
    "request_id": null
}

Response Data

{
    "exception": "AttributeError: 'NoneType' object has no attribute 'amount'",
    "exc_type": "AttributeError",
    "_exc_source": "banking (app)"
}
marination commented 2 days ago

@ashuio This is an error on HRMS' end. Introduced via https://github.com/frappe/hrms/pull/1510. One of the maintainers should get to it soon, will update this ticket when it gets fixed