Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043877
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Loyalty Programs for Web POSmajoralways2020-04-27 12:062020-05-12 16:39
Reporterleyre-iriarteView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityhighResolutionfixedFixed in VersionRR20Q3
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date2019-05-03
Regression introduced in releaseRR19Q3
Regression introduced by commithttps://code.openbravo.com/erp/pmods/org.openbravo.retail.loyalty.programs/rev/fbebc4634da4#l11.168 [^]
Triggers an Emergency PackNo
Summary

0043877: Extra fields are not supported in subcription creation

DescriptionBefore the commit mentioned it was possible to support extra fields added from external modules, but after changing the way of creating subscription it is not possible anymore.

This can potentially lead to synchronization errors (records in Errors While Importing POS Data window) if some SaveSubscriptionHooks depend on data from those extra fields.
Steps To ReproduceBefore 19Q3, the create subscription process worked as a simple JSONProcess. When clicking on the Save button of the create subscription window, the code would iterate all the fields of the window (both standard fields and those added from external modules[1]) and the send all the information to the SaveSubscription java process.

In 19Q3, the subscription creation process was transformed into a data synchronization process in order to support offline operations. With this change, the create subscription window was refactored, and the sendCreateSubscriptionRequest js function was renamed to saveNewSubscription and refactored [2].
While the popup itself still retains the ability to add new fields from external modules (the newAttributes array is still there, and components are created based on this array), these components are no longer taken into account by the saveNewSubscription function.


[1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.loyalty.programs/file/58767b732e01/web/org.openbravo.retail.loyalty.programs/js/view/subscription-create-form.js#l240 [^]

[2] https://code.openbravo.com/erp/pmods/org.openbravo.retail.loyalty.programs/file/tip/web/org.openbravo.retail.loyalty.programs/js/view/subscription-create-form.js#l250 [^]
Proposed SolutionThe saveNewSubscription function should take into account again all the fields part of the newAttributes array.
One possible point to add this would be when the initial subscription json is created[3], right before calling OBRLP.Util.getNewSubscriptionSyncModel().

[3] https://code.openbravo.com/erp/pmods/org.openbravo.retail.loyalty.programs/file/tip/web/org.openbravo.retail.loyalty.programs/js/view/subscription-create-form.js#l269 [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0119537)
hgbot (developer)
2020-05-05 03:04

Repository: erp/pmods/org.openbravo.retail.loyalty.programs
Changeset: 118b023e8d0608adacd820bd487bd90cad155498
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue May 05 06:34:21 2020 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.loyalty.programs/rev/118b023e8d0608adacd820bd487bd90cad155498 [^]

Related to issue 43877 : Subcription Program extra fields should be saved in model

* If fields are added to Subcription Program form through newAttributes,
  when saving the Subcription Program form, extra fields should be saved in model and in database

---
M web/org.openbravo.retail.loyalty.programs/js/utils/obrlputils.js
M web/org.openbravo.retail.loyalty.programs/js/view/subscription-create-form.js
---
(0119593)
hgbot (developer)
2020-05-06 04:51

Repository: erp/pmods/org.openbravo.retail.loyalty.programs
Changeset: 638be122e9fb6b7400d3107c3f11dd03a88a85c6
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed May 06 08:21:39 2020 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.loyalty.programs/rev/638be122e9fb6b7400d3107c3f11dd03a88a85c6 [^]

Related to issue 43877 : Subcription Program extra fields should be saved in model

* If memberId not exists, Subcription Program should be saved with empty memberId

---
M web/org.openbravo.retail.loyalty.programs/js/utils/obrlputils.js
---
(0119644)
adrianromero (manager)
2020-05-06 18:26

Verified
(0119780)
aaroncalero (manager)
2020-05-12 13:47

In our customer environment (upgrading from 19q1 to 20q1) this is still not working.
It seems that the model used to synchronize subscriptions (OB.Model.ChangedLoyaltySubscription) is a copy of the Subscription model: instead of being an (id, jsonobject) pair like most of the synchronization models (orders, changedbps, changedlocations, etc), it has the full definition of the columns that will be saved/synchronized.
Therefore, if we want to add new fields to the Create Subscription popup, we would need to add these fields as properties to 2 different models (the normal subscription and the changed subscription; while in 19q1 it was enough to just create the new field as part of the popup).

Should we assume that it's now required to define the new fields as model attributes? Is this the way of working with this popup now? Or should we wait for a proper fix?
(0119784)
marvintm (manager)
2020-05-12 16:39

Discussed internally. We are in the process of refactoring all sync models so that they work like Aarón suggests, as part of the migration to IndexedDB.Although this will still take a couple of weeks, we don't think refactoring the current model with the old implementation would make sense.

In the meantime, as explained, the model can be extended by adding the specific properties to the model definition.

- Issue History
Date Modified Username Field Change
2020-04-27 12:06 leyre-iriarte New Issue
2020-04-27 12:06 leyre-iriarte Assigned To => Retail
2020-04-27 12:06 leyre-iriarte Resolution time => 1589148000
2020-04-27 12:06 leyre-iriarte Regression date => 2019-05-03
2020-04-27 12:06 leyre-iriarte Regression introduced in release => RR19Q3
2020-04-27 12:06 leyre-iriarte Regression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.loyalty.programs/rev/fbebc4634da4#l11.168 [^]
2020-04-27 12:06 leyre-iriarte Triggers an Emergency Pack => No
2020-04-27 12:22 aaroncalero Description Updated View Revisions
2020-04-27 12:22 aaroncalero Steps to Reproduce Updated View Revisions
2020-04-27 12:22 aaroncalero Proposed Solution updated
2020-05-04 15:07 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2020-05-04 15:07 ranjith_qualiantech_com Status new => scheduled
2020-05-05 03:04 hgbot Checkin
2020-05-05 03:04 hgbot Note Added: 0119537
2020-05-06 04:51 hgbot Checkin
2020-05-06 04:51 hgbot Note Added: 0119593
2020-05-06 07:47 ranjith_qualiantech_com Status scheduled => resolved
2020-05-06 07:47 ranjith_qualiantech_com Resolution open => fixed
2020-05-06 18:26 adrianromero Review Assigned To => adrianromero
2020-05-06 18:26 adrianromero Note Added: 0119644
2020-05-06 18:26 adrianromero Status resolved => closed
2020-05-06 18:26 adrianromero Fixed in Version => RR20Q2
2020-05-12 13:47 aaroncalero Note Added: 0119780
2020-05-12 13:47 aaroncalero Status closed => new
2020-05-12 13:47 aaroncalero Resolution fixed => open
2020-05-12 13:47 aaroncalero Fixed in Version RR20Q2 =>
2020-05-12 16:39 marvintm Note Added: 0119784
2020-05-12 16:39 marvintm Status new => scheduled
2020-05-12 16:39 marvintm Status scheduled => resolved
2020-05-12 16:39 marvintm Fixed in Version => RR20Q3
2020-05-12 16:39 marvintm Resolution open => fixed
2020-05-12 16:39 marvintm Review Assigned To adrianromero => marvintm
2020-05-12 16:39 marvintm Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker