Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0057851
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[POS2] POSmajorhave not tried2024-12-16 10:402025-02-11 09:01
ReporterjayalaView Statuspublic 
Assigned TojavierRodriguez 
PrioritynormalResolutionfixedFixed in Version24Q4.1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version24Q4.2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0057851: Suggestions Engine use initial form values to make suggestions

DescriptionIn POS, if Suggestion Engine should suggest something, it's using the initial form values to make suggestions, instead the updated values.
Steps To Reproduce1. Select a customer an edit any address.
2. Change Postal Code.
3. Type something into Address Line 1 to get suggestions.

This suggestions will be related to initial Postal Code, and not to the changed. Once you save the form, and opened again, data is saved, and the suggestions will be correctly generated.

This is also easily noticeable by using the network debugger, watching the network requests done to "getPropertySuggestion" endpoint (this is automatically requested when a the POS is going to show suggestions). Inside the request, the sent entity will contain the old data.

HOW TO REPRODUCE WITH SAMPLEBPINTEGRATION:
Having org.openbravo.retail.samplebpintegration module installed, and the CRM Dataset of this module imported and having CRM without coding enabled (at client window)
1. Select Arturo Montoro as customer an edit "Calle Estafeta 25" address.
2. Change Postal Code: Delete the input and type "310" to view some suggest, select "31010 - Baranain"
3. WITHOUT SAVE OR EXIT THE FORM, change again the Postal Code: Delete the input and type again "310" to watch some suggest, choose "31013 - Berriozar"
4. In network debbuger, the request to getPropertySuggestions, at payload, has entity.postalCode set to 31001. This is not correct because at UI the Postal Code have changed.
5. The infrastructure is using the old postalCode, and this is because the entity which is send to the server is not updated when is sent.
Proposed SolutionAt CustomerFormHandlerUtils.js:
 1. Inside function "setFieldProperties", probably in payload.properties, another property is necessary >> valueChanged: true
 2. Inside function "propertyFormSuggestionSelected":
  2.1. Inside if "useSuggestionEngine" and "field.obAutoResolveSelection", the function "setFieldProperties" is executed with some arguments. Probably one of them is incorrect (probably field.data). If not, the call to this function is incorrect and some code will need to be developed inside these two if's.
  2.2. The variable "entityForSuggestions" is created using objectToValidate.getPlainObject(), which probably is not correct because this is using the old entity (not with the updated data). Probably this is not necessarily a bug and this code it's ok, because the real bug is in first point, and if it's solved, all be ok.

Take into account that this is some developer research after a debugging session, so this solutions/conclusions are not necessary correct.

HOW TO REPRODUCE WITH SAMPLEBPINTEGRATION:
Having org.openbravo.retail.samplebpintegration module installed, and the CRM Dataset of this module imported and having CRM without coding enabled (at client window)
1. Select Arturo Montoro as customer an edit "Calle Estafeta 25" address.
2. Change Postal Code: Delete the input and type "310" to view some suggest, select "31010 - Baranain"
3. WITHOUT SAVE OR EXIT THE FORM, change again the Postal Code: Delete the input and type again "310" to watch some suggest, choose "31013 - Berriozar"
4. In network debbuger, the request to getPropertySuggestions, at payload, has entity.postalCode set to 31001. This is not correct because at UI the Postal Code have changed.
5. The infrastructure is using the old postalCode, and this is because the entity which is send to the server is not updated when is sent.

* A video have been attached to clarify how to reproduce the error.
* The problem (probably) is not from suggest, it's because the infrastructure doesn't update internally the state of the form and later the entity is not correctly sent.

Have fun!
¯\_( ͡❛ ͜ʖ ͡❛)_/¯
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0057455 closedjavierRodriguez Suggestions Engine use initial form values to make suggestions 

-  Notes
(0175433)
hgbot (developer)
2025-02-10 16:27

Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1759 [^]
(0175460)
hgbot (developer)
2025-02-11 09:01

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 39839238767a2b87909a43d82107186771cc6823
Author: Javier Rodriguez Regueiro <j.rodriguez@orisha.com>
Date: 10-02-2025 16:26:02
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2/-/commit/39839238767a2b87909a43d82107186771cc6823 [^]

Fixes ISSUE-57851: get form state from the reference in BaseForm

---
M web-jspack/org.openbravo.core2/src/components/Form/BaseForm.jsx
---
(0175461)
hgbot (developer)
2025-02-11 09:01

Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1759 [^]

- Issue History
Date Modified Username Field Change
2025-02-04 09:11 guilleaer Type defect => backport
2025-02-04 09:11 guilleaer Target Version => 24Q4.2
2025-02-06 12:40 guilleaer Severity minor => major
2025-02-10 16:27 hgbot Note Added: 0175433
2025-02-11 09:01 hgbot Resolution open => fixed
2025-02-11 09:01 hgbot Status scheduled => closed
2025-02-11 09:01 hgbot Fixed in Version => 24Q4.1
2025-02-11 09:01 hgbot Note Added: 0175460
2025-02-11 09:01 hgbot Note Added: 0175461


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker