Openbravo Issue Tracking System - POS2
View Issue Details
0052346POS2POSpublic2023-05-04 11:292023-05-16 09:25
AugustoMauch 
meriem_azaf 
normalminorhave not tried
closedfixed 
5
 
23Q2.123Q2.1 
approved
No
No
0052346: 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
TO BE DONE
No tags attached.
blocks defect 0052345 closed meriem_azaf Some keymap editor errors could be mitigated 
Issue History
2023-05-04 11:29AugustoMauchTypedefect => backport
2023-05-04 11:29AugustoMauchTarget Version => 23Q2.1
2023-05-12 09:13hgbotMerge Request Status => open
2023-05-12 09:13hgbotNote Added: 0149652
2023-05-16 09:25hgbotMerge Request Statusopen => approved
2023-05-16 09:25hgbotResolutionopen => fixed
2023-05-16 09:25hgbotStatusscheduled => closed
2023-05-16 09:25hgbotNote Added: 0149769
2023-05-16 09:25hgbotFixed in Version => 23Q2.1
2023-05-16 09:25hgbotNote Added: 0149770

Notes
(0149652)
hgbot   
2023-05-12 09:13   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1786 [^]
(0149769)
hgbot   
2023-05-16 09:25   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1786 [^]
(0149770)
hgbot   
2023-05-16 09:25   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 57fbe1a57423cc0271f9b6fca1f2bce4131fbb5c
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 16-05-2023 07:25:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/57fbe1a57423cc0271f9b6fca1f2bce4131fbb5c [^]

Fixes ISSUE-52346: 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
---