Openbravo Issue Tracking System - Retail Modules
View Issue Details
0031607Retail ModulesWeb POSpublic2015-11-26 18:382016-02-05 16:08
daniOpenbravo 
adrianromero 
normalminoralways
closedfixed 
3014.04
 
RR16Q2 
marvintm
No
0031607: [HGVOL] Retail Best Sellers module does not work with HGVOL.
Retail Best Sellers module (org.openbravo.retail.bestsellers) does not work with HGVOL.
Enable High Volumes preference.
1. Log in the ERP.
2. Go to POS Terminal Type window and select any record.
3. Set "Has Bestsellers" field = Y.
4. In Best Sellers tab, select a product and set it as Best Seller= Y.
5. Log in Web POS with a terminal that belongs to the terminal type configured on step 2.
6. Search the product defined on step 4.
7. Realize that this product does not appear as Best Seller.
No tags attached.
related to design defect 0032014 closed adrianromero [SERQA 614]PaidReceipts java class has hardcoded the position for fields 
blocks feature request 0031986 closed Sandrahuguet [HGVOL] support filtering by bestsellers in search view 
Issue History
2015-11-26 18:38daniOpenbravoNew Issue
2015-11-26 18:38daniOpenbravoAssigned To => Retail
2015-11-26 18:38daniOpenbravoResolution time => 1449702000
2015-11-26 18:38daniOpenbravoTriggers an Emergency Pack => No
2015-12-17 17:01SandrahuguetIssue Monitored: Sandrahuguet
2015-12-17 18:16daniOpenbravoIssue Monitored: daniOpenbravo
2016-01-14 11:52hgbotCheckin
2016-01-14 11:52hgbotNote Added: 0083290
2016-01-14 11:52hgbotStatusnew => resolved
2016-01-14 11:52hgbotResolutionopen => fixed
2016-01-14 11:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b8d61eac6b08896c29b896fa9cc335ef67e570b3 [^]
2016-01-14 11:53hgbotCheckin
2016-01-14 11:53hgbotNote Added: 0083291
2016-01-14 11:54hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b8d61eac6b08896c29b896fa9cc335ef67e570b3 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.bestsellers/rev/4ebe33304373a442ad8628eb5649e6579ecde12c [^]
2016-01-14 11:55adrianromeroReview Assigned To => mtaal
2016-01-19 09:58marvintmNote Added: 0083392
2016-01-20 00:22mtaalNote Added: 0083421
2016-01-20 00:22mtaalStatusresolved => new
2016-01-20 00:23mtaalResolutionfixed => open
2016-01-27 15:55SandrahuguetRelationship addedblocks 0031986
2016-01-27 15:58marvintmAssigned ToRetail => adrianromero
2016-02-01 09:27hgbotCheckin
2016-02-01 09:27hgbotNote Added: 0083765
2016-02-01 09:27hgbotStatusnew => resolved
2016-02-01 09:27hgbotResolutionopen => fixed
2016-02-01 09:27hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.bestsellers/rev/4ebe33304373a442ad8628eb5649e6579ecde12c [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0b24bc21cf33665ff29b51fd2dd720c0a54efd04 [^]
2016-02-01 09:27hgbotCheckin
2016-02-01 09:27hgbotNote Added: 0083766
2016-02-01 09:27hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0b24bc21cf33665ff29b51fd2dd720c0a54efd04 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6b29ce12e7f84d5a1ff8701585552e0fbc14ad93 [^]
2016-02-01 09:29hgbotCheckin
2016-02-01 09:29hgbotNote Added: 0083767
2016-02-01 09:29hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6b29ce12e7f84d5a1ff8701585552e0fbc14ad93 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.bestsellers/rev/8d3ebfe3d2b98fdb4f2613b1ae7acf098cdc8211 [^]
2016-02-01 10:59adrianromeroRelationship addedrelated to 0032014
2016-02-01 11:10adrianromeroNote Added: 0083779
2016-02-01 11:42mtaalNote Added: 0083781
2016-02-01 11:49hgbotCheckin
2016-02-01 11:49hgbotNote Added: 0083782
2016-02-01 11:49hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.bestsellers/rev/8d3ebfe3d2b98fdb4f2613b1ae7acf098cdc8211 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1632372dc10a40ad5eee1f3e48a871da0d4aadff [^]
2016-02-05 16:08marvintmReview Assigned Tomtaal => marvintm
2016-02-05 16:08marvintmStatusresolved => closed
2016-02-05 16:08marvintmFixed in Version => RR16Q2

Notes
(0083290)
hgbot   
2016-01-14 11:52   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: b8d61eac6b08896c29b896fa9cc335ef67e570b3
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Fri Jan 08 16:06:37 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b8d61eac6b08896c29b896fa9cc335ef67e570b3 [^]

Fixes issue 0031607: [HGVOL] Retail Best Sellers module does not work with HGVOL.
* Implemented in the server side the new logic for best sellers at terminal type level

---
M src/org/openbravo/retail/posterminal/master/Product.java
M src/org/openbravo/retail/posterminal/master/ProductProperties.java
---
(0083291)
hgbot   
2016-01-14 11:53   
Repository: erp/pmods/org.openbravo.retail.bestsellers
Changeset: 4ebe33304373a442ad8628eb5649e6579ecde12c
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Jan 14 11:53:44 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.bestsellers/rev/4ebe33304373a442ad8628eb5649e6579ecde12c [^]

Fixes issue 0031607: [HGVOL] Retail Best Sellers module does not work with HGVOL.
* Removing local functionality. Now all Best Sellers logic goes in the backend. in the org.openbravo.retail.posterminal module

---
R src/org/openbravo/retail/bestsellers/BestComponentProvider.java
R src/org/openbravo/retail/bestsellers/master/BestSellers.java
R web/org.openbravo.retail.bestsellers/js/components/ModelHooks.js
R web/org.openbravo.retail.bestsellers/js/model/BestSellers.js
---
(0083392)
marvintm   
2016-01-19 09:58   
Hi,

Although I like the idea of using the bestsellers flag both for local mode and remote mode a lot, I think there is one specific part of the solution should should be done in a better way.

Currently, the code which generates this bestsellers flag is now in the posterminal module, with a call to a local method to check if a particular module is installed:

if (Product.hasBestSellersModule()) {

This is fundamentally wrong, and goes against the principles of modularity. Instead of doing it this way, the code inside this if should be moved to a separate class, which extends the ModelExtension class, with the proper qualifier so that the property is included in the query contained in the Product.java.

Once this is done, it will likely fail at this point, because the ModelExtensionUtils.getPropertyExtensions method is not prepared to handle the case of overwriting properties. However, this should be very easy to fix inside this method (or even inside the addAll method in the HQLPropertyList class), and this way the code ends up being much cleaner, and at the same time we will have added a capability which didn't exist before (the ability to overwrite properties in Core modules).

Please contact me if you think there is something else missing.
(0083421)
mtaal   
2016-01-20 00:21   
Yes I agree with the comments from Antonio, re-opening the issue.

gr. Martin
(0083765)
hgbot   
2016-02-01 09:27   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 0b24bc21cf33665ff29b51fd2dd720c0a54efd04
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Jan 28 17:51:06 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0b24bc21cf33665ff29b51fd2dd720c0a54efd04 [^]

Fixes issue 0031607: [HGVOL] Retail Best Sellers module does not work with HGVOL.
* Adding priority property to HQLProperty to implement overwritting of HQLProperty objects in modules

---
M src/org/openbravo/mobile/core/model/HQLProperty.java
M src/org/openbravo/mobile/core/model/HQLPropertyList.java
---
(0083766)
hgbot   
2016-02-01 09:27   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 6b29ce12e7f84d5a1ff8701585552e0fbc14ad93
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Fri Jan 29 13:51:39 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6b29ce12e7f84d5a1ff8701585552e0fbc14ad93 [^]

Fixes issue 0031607: [HGVOL] Retail Best Sellers module does not work with HGVOL.
* Backward compatibility code for properties with the same priority

---
M src/org/openbravo/mobile/core/model/HQLPropertyList.java
---
(0083767)
hgbot   
2016-02-01 09:29   
Repository: erp/pmods/org.openbravo.retail.bestsellers
Changeset: 8d3ebfe3d2b98fdb4f2613b1ae7acf098cdc8211
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Jan 28 18:20:15 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.bestsellers/rev/8d3ebfe3d2b98fdb4f2613b1ae7acf098cdc8211 [^]

Fixes issue 0031607: [HGVOL] Retail Best Sellers module does not work with HGVOL.
* Implement best sellers logic in bestseller HQL field

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_MODULE.xml
M src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
A src/org/openbravo/retail/bestsellers/BestSellersProperties.java
---
(0083779)
adrianromero   
2016-02-01 11:10   
The fix adds a new property to HQLProperty object: priority, to set the priority of a field.

Then HQLPropertyList generates the HQL part with all the HQLProperty fields and if there are HQLProperty fields with the same name and different priority, only the HQLProperty field with higher priority is kept in the HQL.

For backward compatibility reasons, the order of addition of HQLProperty fields is maintained and also if there are different HQLProperty fields with the same name and priority, both are added.
(0083781)
mtaal   
2016-02-01 11:42   
Hi Adrian,
I am reviewing, looks good afaics, but this part of the code can go right?
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/436df3ddebfa/src/org/openbravo/retail/posterminal/master/ProductProperties.java#l82 [^]

and this one to:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/tip/src/org/openbravo/retail/posterminal/master/Product.java#l263 [^]

As a side remark, I am not a big fan of final methods. This greatly limits possibilities of other code to extend/override/solve things. So imho no method should be final unless there is a specific reason for that specific method to be final (honestly I have had this maybe once or twice in the past 15 years, maybe not even, can't remember even :-) ).
(0083782)
hgbot   
2016-02-01 11:49   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 1632372dc10a40ad5eee1f3e48a871da0d4aadff
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Jan 28 17:44:33 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1632372dc10a40ad5eee1f3e48a871da0d4aadff [^]

Fixes issue 0031607: [HGVOL] Retail Best Sellers module does not work with HGVOL.
* Moving BestSellers logic to BestSellers module.

---
M src/org/openbravo/retail/posterminal/master/Product.java
M src/org/openbravo/retail/posterminal/master/ProductProperties.java
---