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

Error while submitting Old Sales Order #85

Closed aasif-patel closed 3 weeks ago

aasif-patel commented 1 month ago

Information about bug

Old sales order like SAL-ORD-2024-00010, SAL-ORD-2024-00009, SAL-ORD-2024-00007 etc throwing error while submitting

image

App Versions

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

Route

Form/Sales Order/SAL-ORD-2024-00010

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/desk/form/save.py", line 37, in savedocs
    doc.submit()
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1048, in submit
    return self._submit()
  File "apps/frappe/frappe/model/document.py", line 1031, in _submit
    return self.save()
  File "apps/frappe/frappe/model/document.py", line 337, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 390, in _save
    self.run_post_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1131, in run_post_save_methods
    self.run_method("on_submit")
  File "apps/frappe/frappe/model/document.py", line 962, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1322, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1304, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 959, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py", line 410, in on_submit
    self.update_prevdoc_status("submit")
  File "apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py", line 394, in update_prevdoc_status
    doc.set_status(update=True)
  File "apps/erpnext/erpnext/controllers/status_updater.py", line 200, in set_status
    elif getattr(self, s[1])():
  File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 206, in is_fully_ordered
    return self.get_ordered_status() == "Ordered"
  File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 160, in get_ordered_status
    ordered_items = frappe._dict(
ValueError: dictionary update sequence element #0 has length 3; 2 is required

Request Data

{
    "type": "POST",
    "args": {
        "doc": "{\"name\":\"SAL-ORD-2024-00010\",\"owner\":\"Administrator\",\"creation\":\"2024-09-27 14:21:43.800238\",\"modified\":\"2024-09-27 14:21:43.800238\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"title\":\"{customer_name}\",\"naming_series\":\"SAL-ORD-.YYYY.-\",\"customer\":\"_Test Customer 3\",\"customer_name\":\"_Test Customer 3\",\"order_type\":\"Sales\",\"transaction_date\":\"2024-09-27\",\"delivery_date\":\"2024-09-27\",\"company\":\"8848 Digital\",\"skip_delivery_note\":0,\"currency\":\"INR\",\"conversion_rate\":1,\"selling_price_list\":\"Standard Selling\",\"price_list_currency\":\"INR\",\"plc_conversion_rate\":1,\"ignore_pricing_rule\":0,\"set_warehouse\":\"Stores - 8D\",\"reserve_stock\":0,\"total_qty\":1,\"total_net_weight\":0,\"base_total\":1000,\"base_net_total\":1000,\"total\":1000,\"net_total\":1000,\"tax_category\":\"In-State\",\"exempt_from_sales_tax\":0,\"base_total_taxes_and_charges\":0,\"total_taxes_and_charges\":0,\"base_grand_total\":1000,\"base_rounding_adjustment\":0,\"base_rounded_total\":1000,\"base_in_words\":\"\",\"grand_total\":1000,\"rounding_adjustment\":0,\"rounded_total\":1000,\"in_words\":\"\",\"advance_paid\":0,\"disable_rounded_total\":0,\"apply_discount_on\":\"Grand Total\",\"base_discount_amount\":0,\"additional_discount_percentage\":0,\"discount_amount\":0,\"customer_group\":\"_Test Customer Group\",\"territory\":\"_Test Territory\",\"company_address\":\"\",\"company_address_display\":\"\",\"status\":\"Draft\",\"delivery_status\":\"Not Delivered\",\"per_delivered\":0,\"per_billed\":0,\"per_picked\":0,\"billing_status\":\"Not Billed\",\"amount_eligible_for_commission\":1000,\"commission_rate\":0,\"total_commission\":0,\"loyalty_points\":0,\"loyalty_amount\":0,\"group_same_items\":0,\"language\":\"en\",\"is_internal_customer\":0,\"doctype\":\"Sales Order\",\"packed_items\":[],\"items\":[{\"name\":\"0t9ul66via\",\"owner\":\"Administrator\",\"creation\":\"2024-09-27 14:21:43.800238\",\"modified\":\"2024-09-27 14:21:43.800238\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"item_code\":\"_Test FG Item\",\"ensure_delivery_based_on_produced_serial_no\":0,\"is_stock_item\":1,\"reserve_stock\":0,\"delivery_date\":\"2024-09-27\",\"item_name\":\"_Test FG Item\",\"description\":\"_Test FG Item 6\",\"item_group\":\"_Test Item Group Desktops\",\"image\":\"\",\"qty\":1,\"stock_uom\":\"_Test UOM\",\"uom\":\"_Test UOM\",\"conversion_factor\":1,\"stock_qty\":1,\"stock_reserved_qty\":0,\"price_list_rate\":1000,\"base_price_list_rate\":1000,\"margin_type\":\"\",\"margin_rate_or_amount\":0,\"rate_with_margin\":0,\"discount_percentage\":0,\"discount_amount\":0,\"base_rate_with_margin\":0,\"rate\":1000,\"amount\":1000,\"base_rate\":1000,\"base_amount\":1000,\"stock_uom_rate\":1000,\"is_free_item\":0,\"grant_commission\":1,\"net_rate\":1000,\"net_amount\":1000,\"base_net_rate\":1000,\"base_net_amount\":1000,\"billed_amt\":0,\"valuation_rate\":0,\"gross_profit\":1000,\"delivered_by_supplier\":0,\"weight_per_unit\":0,\"total_weight\":0,\"warehouse\":\"Stores - 8D\",\"prevdoc_docname\":\"SAL-QTN-2024-00001\",\"quotation_item\":\"t713gl5jbn\",\"against_blanket_order\":0,\"blanket_order_rate\":0,\"bom_no\":\"BOM-_Test FG Item-001\",\"projected_qty\":2,\"actual_qty\":0,\"ordered_qty\":0,\"planned_qty\":0,\"production_plan_qty\":0,\"work_order_qty\":0,\"delivered_qty\":0,\"produced_qty\":0,\"returned_qty\":0,\"picked_qty\":0,\"page_break\":0,\"item_tax_rate\":\"{}\",\"transaction_date\":\"2024-09-27\",\"parent\":\"SAL-ORD-2024-00010\",\"parentfield\":\"items\",\"parenttype\":\"Sales Order\",\"doctype\":\"Sales Order Item\"}],\"payment_schedule\":[{\"name\":\"0t9uj9ojct\",\"owner\":\"Administrator\",\"creation\":\"2024-09-27 14:21:43.800238\",\"modified\":\"2024-09-27 14:21:43.800238\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"due_date\":\"2024-09-27\",\"invoice_portion\":100,\"discount_type\":\"Percentage\",\"discount\":0,\"payment_amount\":1000,\"outstanding\":1000,\"paid_amount\":0,\"discounted_amount\":0,\"base_payment_amount\":1000,\"parent\":\"SAL-ORD-2024-00010\",\"parentfield\":\"payment_schedule\",\"parenttype\":\"Sales Order\",\"doctype\":\"Payment Schedule\"}],\"taxes\":[],\"sales_team\":[],\"pricing_rules\":[],\"__last_sync_on\":\"2024-09-30T06:48:39.192Z\"}",
        "action": "Submit"
    },
    "btn": {
        "jQuery370085404449215001171": {
            "events": {
                "click": [
                    {
                        "type": "click",
                        "origType": "click",
                        "guid": 9331,
                        "namespace": ""
                    }
                ]
            }
        }
    },
    "freeze": true,
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.desk.form.save.savedocs",
    "request_id": null
}

Response Data

{
    "exception": "ValueError: dictionary update sequence element #0 has length 3; 2 is required",
    "exc_type": "ValueError",
    "_exc_source": "erpnext (app)"
}

Module

other

Version

ERPNext: v15.34.0 (pre-prod)

Frappe Framework: v15.41.0 (pre-prod)

Payments: v0.0.1 (version-15)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

tinadn commented 3 weeks ago

@aasif-patel This is working fine.