Fix Odoo reconciliation for existing opportunity links

This commit is contained in:
plx
2026-07-29 15:15:57 +00:00
parent bbfadfa0fd
commit de5b8f1e66
2 changed files with 418 additions and 1 deletions

View File

@@ -742,7 +742,6 @@ def _existing_odoo_sale_links(external_id: Any, order_name: Any) -> List[Dict[st
JOIN opportunities o ON o.id = ol.opportunity_id
WHERE ol.system = 'odoo'
AND ol.external_type = 'sale_order'
AND o.status = 'open'
AND (
(NULLIF(:external_id, '') IS NOT NULL AND ol.external_id = :external_id)
OR (NULLIF(:order_name, '') IS NOT NULL AND UPPER(COALESCE(ol.external_name, '')) = UPPER(:order_name))