Openbravo Issue Tracking System - POS2
View Issue Details
0052345POS2POSpublic2023-05-04 11:292023-05-12 08:43
AugustoMauch 
meriem_azaf 
normalminorhave not tried
closedfixed 
5
 
23Q3 
approved
No
No
0052345: Some keymap editor errors could be mitigated
Some of the keymap editor errors that result from making changes from a terminal that does not contain the latest terminal info can be mitigated so that an Error while importing is not created.

In particular, for all entities that do not have child tabs, instead of creating an EWI when we find that a unique constraint is going to be broken, we could instead overwrite the value of the existing entry
- Open the backoffice
- Open the POS Keymap window
- Add a new Product (i.e. Alpine ski boot) to Main App Keymap -> v1 -> Best Sellers. Add the product but do not add a position yet


- Open POS2
- Clean cache (to force a full master data refresh)
- Log in
- Open the Keymap Editor

- In the backend, add a new position to the keymap product you added in the steps above

- Back in POS2, go to the edit layout step of Main App Keymap, and move the new product (should initially be in the grid in the left) to the grid in the right, to any position.
- Click on the save button. Check that there has been an error in Eclipse and that there is a new entry in the Error While Importing window
No tags attached.
depends on backport 005234623Q2.1 closed meriem_azaf Some keymap editor errors could be mitigated 
depends on backport 005234723Q1.3 closed meriem_azaf Some keymap editor errors could be mitigated 
Issue History
2023-05-04 11:29AugustoMauchNew Issue
2023-05-04 11:29AugustoMauchAssigned To => meriem_azaf
2023-05-04 11:29AugustoMauchOBNetwork customer => No
2023-05-04 11:29AugustoMauchTriggers an Emergency Pack => No
2023-05-04 11:29AugustoMauchStatusnew => scheduled
2023-05-05 09:48AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=26001#r26001
2023-05-05 13:40hgbotMerge Request Status => open
2023-05-05 13:40hgbotNote Added: 0149369
2023-05-12 08:43hgbotMerge Request Statusopen => approved
2023-05-12 08:43hgbotResolutionopen => fixed
2023-05-12 08:43hgbotStatusscheduled => closed
2023-05-12 08:43hgbotNote Added: 0149646
2023-05-12 08:43hgbotFixed in Version => 23Q3
2023-05-12 08:43hgbotNote Added: 0149648

Notes
(0149369)
hgbot   
2023-05-05 13:40   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1763 [^]
(0149646)
hgbot   
2023-05-12 08:43   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1763 [^]
(0149648)
hgbot   
2023-05-12 08:43   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: fd32cdcdc4ea6f319152d0ced782e207b944e568
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 12-05-2023 08:19:06
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/fd32cdcdc4ea6f319152d0ced782e207b944e568 [^]

Fixes ISSUE-52345: When saving keymap editor changes, update existing row if possible

The KeymapLoader was already trying to update an existing row instead of creating a new one that would result in a database
contraint not being met, and an Error While Importing being generated. This worked fine when the id of the existing record
was the same as the id of the record being saved from the frontend. That is the most common case, but if the terminal did
not have the latest keymap information data, it could be that a equivalent record to an another one in the backend was created
(different ID, but same unique properties).

For those entities that do not have subtabs (that is, no other entities reference them), instead of creating the duplicated record
we can apply the new changes coming from the frontend to the existing record in the frontend, even if they have different IDs

---
M src/org/openbravo/pos2/KeymapLoader.java
---