Openbravo Issue Tracking System - POS2
View Issue Details
0054176POS2Corepublic2023-12-20 11:512024-01-31 08:47
marvintm 
gonzalo_fernandez 
normalmajorhave not tried
closedfixed 
5
 
 
approved
No
No
0054176: It should be possible to prevent undo from being available for specific state actions over an undoable model
Currently the infrastructure allows to flag a state model as undoable. This is used for the Ticket model in POS mainly at the moment.

Once the model is undoable, then the infrastructure keeps the previous state for model-specific actions, so that if undo is triggered, this state can be recovered and replaces the current one. This is possible currently for all actions for the undoable model.

However, we have identified some specific actions for which undo should not be possible, as functionally it doesn't make sense, and causes data integrity problems. We need a way to notify the infrastructure this, so that it automatically disables the undo in case these particular actions are triggered
.
Ideally, it would be great if it would be possible to flag some specific action when it is being registered, so that its execution disables the undo.
No tags attached.
depends on backport 005451124Q1 closed Triage Platform Base POS2 It should be possible to prevent undo from being available for specific state actions over an undoable model 
related to defect 0053889 closed malsasua Retail Modules Payment is deleted but removePayment function is not executed 
Issue History
2023-12-20 11:51marvintmNew Issue
2023-12-20 11:51marvintmAssigned To => Triage Platform Base
2023-12-20 11:51marvintmOBNetwork customer => No
2023-12-20 11:51marvintmTriggers an Emergency Pack => No
2024-01-02 12:55hgbotMerge Request Status => open
2024-01-02 12:55hgbotNote Added: 0158764
2024-01-02 12:55hgbotNote Added: 0158765
2024-01-17 09:31hgbotMerge Request Statusopen => approved
2024-01-19 12:52hgbotNote Added: 0159530
2024-01-19 12:52hgbotResolutionopen => fixed
2024-01-19 12:52hgbotStatusnew => closed
2024-01-19 12:52hgbotFixed in Version => RR24Q2
2024-01-19 12:52hgbotNote Added: 0159531
2024-01-19 12:52hgbotNote Added: 0159532
2024-01-19 12:52hgbotNote Added: 0159533
2024-01-31 07:21guillermogilRelationship addedrelated to 0053889
2024-01-31 08:43AugustoMauchStatusclosed => new
2024-01-31 08:43AugustoMauchResolutionfixed => open
2024-01-31 08:43AugustoMauchFixed in VersionRR24Q2 =>
2024-01-31 08:44AugustoMauchStatusnew => scheduled
2024-01-31 08:44AugustoMauchStatusscheduled => resolved
2024-01-31 08:44AugustoMauchResolutionopen => fixed
2024-01-31 08:44AugustoMauchStatusresolved => closed
2024-01-31 08:47AugustoMauchAssigned ToTriage Platform Base => gonzalo_fernandez
2024-01-31 08:47AugustoMauchAssigned Togonzalo_fernandez => AugustoMauch
2024-01-31 08:47AugustoMauchAssigned ToAugustoMauch => gonzalo_fernandez

Notes
(0158764)
hgbot   
2024-01-02 12:55   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1439 [^]
(0158765)
hgbot   
2024-01-02 12:55   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/650 [^]
(0159530)
hgbot   
2024-01-19 12:52   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/650 [^]
(0159531)
hgbot   
2024-01-19 12:52   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 17d44894d3675bf7c939f8d041eb238fde56b5c1
Author: Gonzalo Fernández García <gonzalo.fernandez@openbravo.com>
Date: 17-01-2024 09:16:28
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/17d44894d3675bf7c939f8d041eb238fde56b5c1 [^]

Fixes ISSUE-54176: Changes the State API to support not undoable user actions

Now undoable models can define some of their actions to be non-undoable by using the following API:

  OB.App.StateAPI.Ticket.registerAction('deletePayment', {
    isUndoable: false,
    implementation: (ticket, payload) => {
      ...
    }
  }

---
M web-test/model/application-state/StateUndo.functional.test.js
M web/org.openbravo.mobile.core/app/model/application-state/State.js
M web/org.openbravo.mobile.core/app/model/application-state/StateAPI.js
---
(0159532)
hgbot   
2024-01-19 12:52   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1439 [^]
(0159533)
hgbot   
2024-01-19 12:52   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: c1e16a4d4423dd94792127dea45990b76f2a9ddd
Author: Gonzalo Fernández García <gonzalo.fernandez@openbravo.com>
Date: 19-01-2024 11:51:58
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/c1e16a4d4423dd94792127dea45990b76f2a9ddd [^]

Relatead to ISSUE-54176: Sets addPayment and deletePayment user actions as not undoable

---
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/AddPayment.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/DeletePayment.js
---