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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0048939
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajorhave not tried2022-03-31 11:212022-04-17 21:15
ReporterAugustoMauchView Statuspublic 
Assigned Tomeriem_azaf 
PrioritynormalResolutionfixedFixed in VersionRR22Q3
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0048939: Masterdata model that use extensions should take them into account when calculating the hash

DescriptionMasterdata model definition in the backend includes the list of properties that should be taken into account to calculate a hash. That hash will then be used to determine when those properties have changed, in order to force a full refresh.

Currently there are two methods that return the list of fields to take into account for the hash:
- one that accepts the list of ModelExtension [1] and that returns the list of all properties included in those extensions
- another one that accepts an entity [2] and that returns all the properties of the given entity

The second one SHOULD NEVER be used in a master data model that uses ModelExtension, because if a new extension is included, or a new property in an existing extension is included, the new properties will not be included in the hash, and the full master data refresh that should take place will not happen.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/src/org/openbravo/mobile/core/master/MasterDataProcessHQLQuery.java#L102 [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/src/org/openbravo/mobile/core/master/MasterDataProcessHQLQuery.java#L118 [^]
Steps To ReproduceOne one hand, this is straightforward to see. Check what master data model are invoking this function and realize that all of them are using ModelExtension to build the HQL query.

To reproduce it:
- Start WebPOS and log in.
- Stop tomcat, add a any property to TaxCategoryProperties that adds a new property from a separate entity, i.e.:
    list.add(new HQLProperty("organization.name", "orgName"));
- Build the application
- Restart tomcat
- Log in again in WebPOS, no full refresh is done, this is wrong

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/src/org/openbravo/mobile/core/master/MasterDataProcessHQLQuery.java#L118 [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0048884 closedmeriem_azaf Full Refresh generated in deploy without changes or model insertion in webPOS 

-  Notes
(0136436)
hgbot (developer)
2022-04-08 11:25

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/768 [^]
(0136539)
hgbot (developer)
2022-04-17 21:15

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/768 [^]
(0136540)
hgbot (developer)
2022-04-17 21:15

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: a1d984ee41c366830023a52597ba0d6400f6ed5f
Author: Meriem Azaf <meriem.azaf@openbravo.com>
Date: 08-04-2022 11:24:51
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/a1d984ee41c366830023a52597ba0d6400f6ed5f [^]

Fixes ISSUE-48939: Masterdata model that use extensions should take them into account when calculating the hash
Masterdata model definition in the backend includes the list of properties that should be taken into account to calculate a hash.
That hash will then be used to determine when those properties have changed, in order to force a full refresh.

Currently there are two methods that return the list of fields to take into account for the hash: getPropertiesFrom
- one that accepts the list of ModelExtension and that returns the list of all properties included in those extensions
- another one that accepts an entity and that returns all the properties of the given entity

The second one SHOULD NEVER be used in a master data model that uses ModelExtension, because if a new extension is included, or a new property in an existing extension is included, the new properties will not be included in the hash, and the full master data refresh that should take place will not happen.
To fix this, we search where the second method used and check if this module use the ModelExtension and after do the change.

---
M src/org/openbravo/retail/posterminal/master/Discount.java
M src/org/openbravo/retail/posterminal/master/ProductServiceLinked.java
M src/org/openbravo/retail/posterminal/master/TaxCategory.java
M src/org/openbravo/retail/posterminal/master/TaxCategoryBOM.java
---

- Issue History
Date Modified Username Field Change
2022-03-31 11:21 AugustoMauch New Issue
2022-03-31 11:21 AugustoMauch Assigned To => Triage Platform Base
2022-03-31 11:21 AugustoMauch Triggers an Emergency Pack => No
2022-03-31 11:21 AugustoMauch Relationship added related to 0048884
2022-04-06 16:03 AugustoMauch Assigned To Triage Platform Base => meriem_azaf
2022-04-06 16:03 AugustoMauch Status new => scheduled
2022-04-08 11:25 hgbot Note Added: 0136436
2022-04-17 21:15 hgbot Note Added: 0136539
2022-04-17 21:15 hgbot Resolution open => fixed
2022-04-17 21:15 hgbot Status scheduled => closed
2022-04-17 21:15 hgbot Fixed in Version => RR22Q3
2022-04-17 21:15 hgbot Note Added: 0136540


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker