Openbravo Issue Tracking System - Retail Modules
View Issue Details
0044236Retail ModulesWeb POSpublic2020-05-29 10:472020-06-04 11:38
jarmendariz 
jarmendariz 
highmajorhave not tried
closedfixed 
5
 
RR20Q3RR20Q3 
caristu
No
0044236: Action Preparations for Model actions receives the whole State instead of the Model
To remain consistent with the implementation of pre/post hooks, action functions and Model hooks, action preparations should receive only the part of the State related to the model. An exception to this rule is the action preparation of a global action.
Create an action preparation for a Model action. For example:

OB.App.StateAPI.TerminalLog.addLog.addActionPreparation(
    async (state, payload) => {
      payload.max = state.TerminalLog.eventsMaximumNumber;
    }
);

Notice that you have to execute state.TerminalLog to access the TerminalLog properties. This should be the correct way:

OB.App.StateAPI.TerminalLog.addLog.addActionPreparation(
    async (terminalLog, payload) => {
      payload.max = terminalLog.eventsMaximumNumber;
    }
);
No tags attached.
related to feature request 0043701 new Retail Implement local data storage with IndexedDB 
Issue History
2020-05-29 10:47jarmendarizNew Issue
2020-05-29 10:47jarmendarizAssigned To => jarmendariz
2020-05-29 10:47jarmendarizTriggers an Emergency Pack => No
2020-05-29 10:47jarmendarizStatusnew => scheduled
2020-06-03 11:36hgbotCheckin
2020-06-03 11:36hgbotNote Added: 0120573
2020-06-03 11:36hgbotStatusscheduled => resolved
2020-06-03 11:36hgbotResolutionopen => fixed
2020-06-03 11:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/868f0cf6ef0bfde1cec91f3c2503dea8b812dd39 [^]
2020-06-03 11:36hgbotCheckin
2020-06-03 11:36hgbotNote Added: 0120574
2020-06-04 11:26caristuReview Assigned To => caristu
2020-06-04 11:26caristuStatusresolved => closed
2020-06-04 11:26caristuFixed in Version => RR20Q3
2020-06-04 11:38caristuRelationship addedrelated to 0043701

Notes
(0120573)
hgbot   
2020-06-03 11:36   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 868f0cf6ef0bfde1cec91f3c2503dea8b812dd39
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Mon Jun 01 11:06:10 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/868f0cf6ef0bfde1cec91f3c2503dea8b812dd39 [^]

Fixed ISSUE-44236: Action preparation first argument should contain only the model instead of the whole state

An exception is the global action model. In this case it can receive the complete State object.

---
M web-test/model/application-state/State.test.js
M web/org.openbravo.mobile.core/app/model/application-state/State.js
---
(0120574)
hgbot   
2020-06-03 11:36   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: bcf0169df475cb485b575ea85ada961f118dc675
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Mon Jun 01 11:53:26 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/bcf0169df475cb485b575ea85ada961f118dc675 [^]

Related to ISSUE-44236: Refactored TerminalLog usages of action preparations

---
M web-test/model/business-object/terminal-log/TerminalLog-AddButtonClick-ActionPreparation.test.js
M web-test/model/business-object/terminal-log/TerminalLog-AddLog-ActionPreparation.test.js
M web-test/model/business-object/terminal-log/TerminalLog-AddProcess-ActionPreparation.test.js
M web-test/model/business-object/terminal-log/TerminalLog-Addkey-ActionPreparation.test.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/TerminalLogUtils.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/actions/AddButtonClick.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/actions/AddKey.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/actions/AddLog.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/actions/AddProcess.js
M web/org.openbravo.mobile.core/app/model/business-object/terminal-log/actions/SetContextAndPopup.js
---