mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-19 01:18:43 +00:00
The Lead Details report concatenated address_line1 and address_line2 with CONCAT_WS. An unfilled optional Data field is stored as '' on MariaDB but as NULL on PostgreSQL; CONCAT_WS keeps the empty string (leaving a trailing ", ") on MariaDB while Postgres drops the NULL, so the same lead rendered a different address on each engine. Wrap both parts in NULLIF(part, '') so empty values are treated as NULL on both engines: the report now produces the same clean address (no trailing separator) everywhere.