Openbravo Issue Tracking System - POS2
View Issue Details
0054511POS2Corepublic2023-12-20 11:512024-02-13 13:51
marvintm 
Triage Platform Base 
normalmajorhave not tried
closedfixed 
5
 
24Q1 
approved
No
No
0054511: 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.
blocks feature request 0054176 closed gonzalo_fernandez It should be possible to prevent undo from being available for specific state actions over an undoable model 
Issue History
2024-01-31 08:44AugustoMauchTypefeature request => backport
2024-01-31 08:44AugustoMauchTarget Version => 24Q1
2024-01-31 08:49hgbotNote Added: 0159968
2024-01-31 08:50hgbotNote Added: 0159969
2024-02-13 13:51hgbotNote Added: 0160688
2024-02-13 13:51hgbotResolutionopen => fixed
2024-02-13 13:51hgbotStatusscheduled => closed
2024-02-13 13:51hgbotFixed in Version => RR24Q1
2024-02-13 13:51hgbotNote Added: 0160689
2024-02-13 13:51hgbotNote Added: 0160690
2024-02-13 13:51hgbotNote Added: 0160691

Notes
(0159968)
hgbot   
2024-01-31 08:49   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/657 [^]
(0159969)
hgbot   
2024-01-31 08:50   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1454 [^]
(0160688)
hgbot   
2024-02-13 13:51   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/657 [^]
(0160689)
hgbot   
2024-02-13 13:51   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 02b25ec124671b8d65a54fb6fa7c4666cfa8a121
Author: Gonzalo Fernández García <gonzalo.fernandez@openbravo.com>
Date: 13-02-2024 12:51:15
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/02b25ec124671b8d65a54fb6fa7c4666cfa8a121 [^]

Fixes ISSUE-54511: 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
---
(0160690)
hgbot   
2024-02-13 13:51   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 64457254a70255511e78415b0cb2124e0c2f448e
Author: Gonzalo Fernández García <gonzalo.fernandez@openbravo.com>
Date: 13-02-2024 12:51:18
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/64457254a70255511e78415b0cb2124e0c2f448e [^]

Relatead to ISSUE-54511: 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
---
(0160691)
hgbot   
2024-02-13 13:51   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1454 [^]