Openbravo Issue Tracking System - Retail Modules
View Issue Details
0048884Retail ModulesWeb POSpublic2022-03-23 19:062022-04-17 21:24
sofidossant 
meriem_azaf 
highmajoralways
closedfixed 
5
RR20Q3 
RR22Q3 
RR20Q3
No
0048884: Full Refresh generated in deploy without changes or model insertion in webPOS
If a model has changed, a frontend hash is stored from the list of properties of which the model is a part.
In 20Q3, in the case of TaxCategory, in TaxCategory.java (the Taxes query), this was done:

  @Override
  public List<String> getMasterDataModelProperties() {
    return getPropertiesFrom(org.openbravo.model.financialmgmt.tax.TaxCategory.class);
  }

In this function, the properties of the TaxCategory entity are returned. This includes the list-like properties that are generated for the "child" models that are marked with IS_CHILD_PROPERTY_IN_PARENT="Y".

When changes are added that are not related to webPOS models, but are children to models that use webPOS, it changes the hash and generates a full refresh on the terminals.

This can happen with various models: discount, taxcategory, taxcategorybom, productservicelinked and more.
- Open the terminal.
- Create a new child table of TaxCategory.
- Deploy.
- A full refresh will be generated in the terminal
Change the following function to ignore child properties

protected static List<String> getPropertiesFrom(Class<?> entityClass) {

Class MasterDataProcessHQLQuery

No tags attached.
related to defect 0048939 closed meriem_azaf Masterdata model that use extensions should take them into account when calculating the hash 
Issue History
2022-03-23 19:06sofidossantNew Issue
2022-03-23 19:06sofidossantAssigned To => AugustoMauch
2022-03-23 19:06sofidossantRegression introduced in release => RR20Q3
2022-03-23 19:06sofidossantTriggers an Emergency Pack => No
2022-03-24 00:23AugustoMauchNote Added: 0135986
2022-03-24 00:23AugustoMauchAssigned ToAugustoMauch => sofidossant
2022-03-24 00:23AugustoMauchStatusnew => feedback
2022-03-24 07:22marvintmNote Added: 0135988
2022-03-24 11:34sofidossantStatusfeedback => new
2022-03-24 11:34sofidossantDescription Updatedbug_revision_view_page.php?rev_id=23809#r23809
2022-03-24 11:35sofidossantAssigned Tosofidossant => AugustoMauch
2022-03-31 11:21AugustoMauchRelationship addedrelated to 0048939
2022-03-31 16:46AugustoMauchAssigned ToAugustoMauch => meriem_azaf
2022-03-31 16:46AugustoMauchStatusnew => scheduled
2022-04-06 12:46hgbotNote Added: 0136354
2022-04-17 21:24hgbotResolutionopen => fixed
2022-04-17 21:24hgbotStatusscheduled => closed
2022-04-17 21:24hgbotFixed in Version => RR22Q3
2022-04-17 21:24hgbotNote Added: 0136541
2022-04-17 21:24hgbotNote Added: 0136542

Notes
(0135986)
AugustoMauch   
2022-03-24 00:23   
Hello Sofia,

I just checked and what you mentioned does not match the code in 20Q3. This [1] is the implementation of TaxRate.getMasterDataModelProperties in 20Q3, and it just lists the properties defined in its ModelExtension. No list properties should be included unless a ModelExtension explicitely includes it.

Where did you get the implementation pasted in the description?

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/blob/release/20Q3/src/org/openbravo/retail/posterminal/master/TaxRate.java#L133 [^]
(0135988)
marvintm   
2022-03-24 07:22   
Hi Augusto,

In fact, there is a mistake in the issue reported, the problem didn't happen with a List property in TaxRate but in TaxCategory instead:

https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/blob/release/20Q3/src/org/openbravo/retail/posterminal/master/TaxCategory.java#L58 [^]

This model (and several others) use a utility method in MasterDataProcessHQLQuery (getPropertiesFrom(Class<?> entityClass). This method returns all the properties of the given entity class, including List properties.

This caused an unintended full refresh in a customer yesterday. We can discuss quickly together if some detail is still missing.
(0136354)
hgbot   
2022-04-06 12:46   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/353 [^]
(0136541)
hgbot   
2022-04-17 21:24   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 9bf6254d9293a9e9307c1aae9a893b22b044545f
Author: Meriem Azaf <meriem.azaf@openbravo.com>
Date: 17-04-2022 21:24:16
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/9bf6254d9293a9e9307c1aae9a893b22b044545f [^]

Fixes ISSUE-48884: Full Refresh generated in deploy without changes or model insertion in webPOS
After doing changes in models that are related to webPOS modules, it changes the hash and generates a full refresh on the terminals.
To fix this,we add a filter in this function getPropertiesFrom in MasterDataProcessHQLQuery to not get list properties that are represented as OneToMany relation.

---
M src/org/openbravo/mobile/core/master/MasterDataProcessHQLQuery.java
---
(0136542)
hgbot   
2022-04-17 21:24   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/353 [^]