Having the same problem here. Trying to add a query to extract order-detail level information suitable for exporting to Excel so I can generate shipping labels. The query runs perfectly fine in phpMyAdmin, but I'm unable to Save it in the Prestashop SQL Manager. Gives 'Undefined "checkdForm" error'
The query started from a snippet someone else had posted (the joins in particular).
SELECT o.current_state "Order_Status", os.name "Order_Status_Descr", d.id_order, d.id_order_detail, d.product_id, d.product_attribute_id, d.id_customization, d.product_name, d.product_quantity, d.product_price, d.product_reference, d.total_price_tax_incl, o.reference "Order_Reference", o.payment, o.total_discounts, o.total_paid, o.date_add, ad.alias "Delivery_Address_Source", ad.LastName "Delivery_LastName", ad.firstname "Delivery_FirstName", ad.address1 "Delivery_Addr1", ad.address2 "Delivery_Addr2", ad.postcode "Delivery_Zip", ad.city "Delivery_City", ad.phone "Delivery_Phone", ad.id_state "Delivery_StateID", sd.iso_code "State_Abbr", sd.name "State_Name", ai.alias "Invoice_Address_Source", ai.LastName "Invoice_LastName", ai.firstname "Invoice_FirstName", ai.address1 "Invoice_Addr1", ai.address2 "Invoice_Addr2", ai.postcode "Invoice_Zip", ai.city "Invoice_City", ai.phone "Invoice_Phone", g.company, g.firstname "Cust_Firstname", g.lastname "Cust_Lastname", g.email "Cust_Email" FROM psar_order_detail d LEFT JOIN psar_orders o ON (d.id_order = o.id_order) LEFT JOIN psar_address ad ON (o.id_address_delivery = ad.id_address) LEFT JOIN psar_state sd ON (ad.id_state = sd.id_state) LEFT JOIN psar_address ai ON (o.id_address_invoice = ai.id_address) LEFT JOIN psar_stock_available s ON (d.product_id = s.id_product) LEFT JOIN psar_customer g ON (o.id_customer = g.id_customer) LEFT JOIN psar_group_lang gl ON (g.id_default_group = gl.id_group) AND gl.name LIKE 'piiri%' LEFT JOIN psar_order_state_lang os ON (o.current_state = os.id_order_state) WHERE os.id_lang = 1 and o.invoice_date >= '2020-03-01' GROUP BY gl.name, d.id_order, d.product_reference
.png.022b5452a8f28f552bc9430097a16da2.png)