salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.26k stars 2.03k forks source link

Value of "currency_id" in custom table changes from NULL to an empty string when saving #10425

Open FR-JS opened 1 month ago

FR-JS commented 1 month ago

Issue

If a module is configured with a custom currency field, an additional column called "currency_id" is also created. When a new record is created this value is NULL. When the record is updated this value is then changed to be an empty string. If the currency field is used within a report with an aggregated function combined with grouping of another column, then the report shows duplicated records due to the differing values of NULL and an empty string.

Expected Behavior

The stored value of the "currency_id" should be consistent

Actual Behavior

For new records "currency_id" is NULL, once opened and resaved this value is then an empty string.

Steps to Reproduce

  1. Add a currency field to a module
  2. Create a new record and save it
  3. Observe the value "currency_id" column in the custom field table is NULL
  4. Create a second record
  5. Open the second record and save it
  6. Observe the value "currency_id" column in the custom field table is now an empty string

Context

Medium priority

Your Environment