Openbravo Issue Tracking System - POS2
View Issue Details
0051757POS2Corepublic2023-03-02 11:532023-07-27 15:23
0051757: StandardStep do not save initial value in context
In a multiStep component that uses a standardStep, the initial values are not saved, so when navigating to the next step, the initial data is not saved.

Note that on change of any field it is saved that field, but not the rest of fields.
Apply the diff included in the issue to revert a hack done.

Enter in pos2,
go to print labels (last entry in the left menu)
don't edit any field,
go to next step,
in selector category select any category like for example 'food'
select any product in the left list so it is added to the second list.

ERROR 1: there is an error in the console:
'Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'scale')'

If debugged and checkend in the context of the multistep, the initial values of the fields of the step1 have not been saved before navigating to step2.

To debugg it:
- in file PrintProductLabelProductListGrid.jsx
- set a break point in line 45 - const { processData } = useMultiStepProcessContext();
- if we click next , procssData comes with properties with value undefined, if changing any value, comes with that value

- probably related to first one, the default values are not loaded till click on reset form. Default values can be edited on PrintProductLabel.config.json
Maybe it is needed to create a useEffect that only is executed once to call to setStepData the first time. Note that if returning to the step from another step this call to setStepData should not be executed again.

Also default values are not loaded till click on reset form, maybe it is needed to execute a reset a form that also saves the initial values on the context. To edit the initial values can be done in : PrintProductLabel.config.json
No tags attached.
diff org.openbravo.pos2.product.label.printing-51757.diff (1,086) 2023-07-04 09:29
Issue History
2023-03-02 11:53gorka_gilNew Issue
2023-03-02 11:53gorka_gilAssigned To => Triage Platform Base
2023-03-02 11:53gorka_gilTriggers an Emergency Pack => No
2023-06-14 15:20rafarodaPriorityhigh => urgent
2023-06-14 15:20rafarodaSeverityminor => major
2023-06-23 09:30AugustoMauchStatusnew => closed
2023-06-23 09:30AugustoMauchResolutionopen => invalid
2023-07-04 09:06gorka_gilStatusclosed => new
2023-07-04 09:06gorka_gilResolutioninvalid => open
2023-07-04 09:29gorka_gilFile Added: org.openbravo.pos2.product.label.printing-51757.diff
2023-07-04 09:43gorka_gilSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=26392#r26392
2023-07-04 09:43gorka_gilProposed Solution updated
2023-07-04 09:47gorka_gilSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=26393#r26393
2023-07-04 10:47gorka_gilPriorityurgent => normal
2023-07-27 10:42meriem_azafAssigned ToTriage Platform Base => meriem_azaf
2023-07-27 10:42meriem_azafStatusnew => acknowledged
2023-07-27 10:43meriem_azafStatusacknowledged => scheduled
2023-07-27 15:23hgbotNote Added: 0152950

2023-07-27 15:23   
Merge Request created: [^]