Openbravo Issue Tracking System - POS2
View Issue Details
0055273POS2POSpublic2024-04-22 11:342024-04-22 13:12
0055273: It is not possible to purposely set null values on the onPropertyValueChange function
For customer and customer addresses objects, setting a null value is currently not possible.
There is a function called 'onPropertyValueChange' in which you can tell which field and with what value to be set. The problem is that if a null value wants to be set in the object, the code executed by the 'setValueFormFields' will prevent it from happening due to a condition in which it is stated that if the property does not have a value, the field's value will be chosen. This causes the impossibility of setting a null value on the properties on purpose.
It should be discussed a better way of fixing the problem that this condition fixes:

" if (field?.value && !property.value) {
      valueToBeUsed = field?.value;

This is the condition that is the one that makes it not possible to set null values in the property values.
It was implemented to fix other issue and works fine for it, but we should discuss a better way of handling it so both functionalities work without stepping in the way of the other.
No tags attached.
Issue History
2024-04-22 11:34NaroaIriarteNew Issue
2024-04-22 11:34NaroaIriarteAssigned To => NaroaIriarte
2024-04-22 11:34NaroaIriarteTriggers an Emergency Pack => No
2024-04-22 13:12NaroaIriarteNote Added: 0163526

2024-04-22 13:12   
This is the issue that introduced the if condition that is causing the impossibility of setting null values on the property values: [^]