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

Sales order- Not able to create sales order from Quotation showing error. #64

Closed rushabhmaywade closed 1 month ago

rushabhmaywade commented 1 month ago

Information about bug

not able to create sales order from Quotation and even in sales order from get item button showing error. image image image

Module

selling

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 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\",\"tax_id\":null,\"order_type\":\"Sales\",\"transaction_date\":\"2024-09-27\",\"delivery_date\":\"2024-09-27\",\"po_no\":null,\"po_date\":null,\"company\":\"8848 Digital\",\"skip_delivery_note\":0,\"amended_from\":null,\"cost_center\":null,\"project\":null,\"currency\":\"INR\",\"conversion_rate\":1,\"selling_price_list\":\"Standard Selling\",\"price_list_currency\":\"INR\",\"plc_conversion_rate\":1,\"ignore_pricing_rule\":0,\"scan_barcode\":null,\"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\",\"taxes_and_charges\":null,\"exempt_from_sales_tax\":0,\"shipping_rule\":null,\"incoterm\":null,\"named_place\":null,\"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,\"coupon_code\":null,\"additional_discount_percentage\":0,\"discount_amount\":0,\"other_charges_calculation\":null,\"customer_address\":null,\"address_display\":null,\"customer_group\":\"_Test Customer Group\",\"territory\":\"_Test Territory\",\"contact_person\":null,\"contact_display\":null,\"contact_phone\":null,\"contact_mobile\":null,\"contact_email\":null,\"shipping_address_name\":null,\"shipping_address\":null,\"dispatch_address_name\":null,\"dispatch_address\":null,\"company_address\":\"\",\"company_address_display\":\"\",\"payment_terms_template\":null,\"tc_name\":null,\"terms\":null,\"status\":\"Draft\",\"delivery_status\":\"Not Delivered\",\"per_delivered\":0,\"per_billed\":0,\"per_picked\":0,\"billing_status\":\"Not Billed\",\"sales_partner\":null,\"amount_eligible_for_commission\":1000,\"commission_rate\":0,\"total_commission\":0,\"loyalty_points\":0,\"loyalty_amount\":0,\"from_date\":null,\"to_date\":null,\"auto_repeat\":null,\"letter_head\":null,\"group_same_items\":0,\"select_print_heading\":null,\"language\":\"en\",\"is_internal_customer\":0,\"represents_company\":null,\"source\":null,\"inter_company_order_reference\":null,\"campaign\":null,\"party_account_currency\":null,\"doctype\":\"Sales Order\",\"taxes\":[],\"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,\"payment_term\":null,\"description\":null,\"due_date\":\"2024-09-27\",\"mode_of_payment\":null,\"invoice_portion\":100,\"discount_type\":\"Percentage\",\"discount_date\":null,\"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\",\"__unsaved\":1}],\"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\",\"customer_item_code\":null,\"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\",\"brand\":null,\"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,\"item_tax_template\":null,\"base_rate\":1000,\"base_amount\":1000,\"pricing_rules\":null,\"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,\"supplier\":null,\"weight_per_unit\":0,\"total_weight\":0,\"weight_uom\":null,\"warehouse\":\"Stores - 8D\",\"target_warehouse\":null,\"prevdoc_docname\":\"SAL-QTN-2024-00001\",\"quotation_item\":\"t713gl5jbn\",\"against_blanket_order\":0,\"blanket_order\":null,\"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,\"additional_notes\":null,\"page_break\":0,\"item_tax_rate\":\"{}\",\"transaction_date\":\"2024-09-27\",\"material_request\":null,\"purchase_order\":null,\"material_request_item\":null,\"purchase_order_item\":null,\"parent\":\"SAL-ORD-2024-00010\",\"parentfield\":\"items\",\"parenttype\":\"Sales Order\",\"doctype\":\"Sales Order Item\",\"__unsaved\":1}],\"packed_items\":[],\"sales_team\":[],\"pricing_rules\":[],\"__last_sync_on\":\"2024-09-27T08:51:45.082Z\"}",
        "action": "Submit"
    },
    "btn": {
        "jQuery370094308969998279161": {
            "events": {
                "click": [
                    {
                        "type": "click",
                        "origType": "click",
                        "guid": 6459,
                        "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)"
}
8848swa commented 1 month ago

While submitting sales order getting same error image

aasif-patel commented 1 month ago

Resolved hence closing...