Quote edit: selecting a Lead replaces the items but leaves the hidden item inputs empty, so the quote can't be saved and it is never linked to the lead

Author: raizen10Created Sep 23, 2026Updated Sep 23, 2026

Bug report

Title

Quote edit: selecting a Lead replaces the items but leaves the hidden item inputs empty, so the quote can't be saved and it is never linked to the lead

Issue Description

On an existing quote that already has items, choosing a Lead in the "Lead" lookup triggers fetchLeadProducts() (packages/Webkul/Admin/src/Resources/views/quotes/edit.blade.php, ~line 785), which replaces this.products with the lead's products. The rows look correct (name and price are shown), but the real hidden inputs that are submitted (items[...][product_id], [quantity], [total], …) end up empty. We confirmed this by reading the actual input[type=hidden] values in the DOM (headless browser), not just what is rendered.

Because QuoteController::additionalValidation() requires those fields, saving fails silently from the user's point of view, and the Lead ↔ Quote link is never written to lead_quotes, even though lead_id is posted correctly.

Creating the quote from inside the lead (Lead → Quotes → Create Quote) works fine, since it doesn't go through this replacement.

Preconditions

  1. Krayin CRM v2.2.6.
  2. A quote that already has at least one item.
  3. A lead with at least one product.

Steps to reproduce

  1. Open the existing quote → Edit.
  2. In "Lead", select the lead.
  3. Save.

Expected result

The quote is saved and appears in the lead's Quotes tab (row in lead_quotes).

Actual result

The quote isn't saved (item validation fails on the empty hidden inputs) and the link to the lead is not created.

Suggested fix

When replacing this.products with the lead's products, map every field the item row binds to its hidden inputs (product_id, quantity, price, total, discount_amount, tax_amount), or re-use addProduct() for each product so rows are initialised the same way as when a product is picked manually.