Openbravo Issue Tracking System - Retail Modules | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0046167 | Retail Modules | Multi UPC/EAN for Product | public | 2021-03-26 15:33 | 2021-04-19 16:04 | |||||||
Reporter | lbressan | |||||||||||
Assigned To | ranjith_qualiantech_com | |||||||||||
Priority | urgent | Severity | major | Reproducibility | always | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | RR20Q3.1 | |||||||||||
Target Version | Fixed in Version | |||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | ||||||||||||
OBNetwork customer | ||||||||||||
Support ticket | ||||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0046167: The "Multi UPC/EAN for Products" module does not recalculate the EM_Obmupc_Multiupc_Desc field | |||||||||||
Description | he "Multi UPC/EAN for Products" module does not recalculate the EM_Obmupc_Multiupc_Desc field when deleting/updating/inserting a record per database script. The EM_Obmupc_Multiupc_Desc field is not recalculated when a record is deleted/updated/inserted by database script or when a java process is created as follows: private int updateUPCOccurrencesByProductOrg(Product product, String upcItem, Organization organization) { //@formatter:off String hql = "update Product " + "set uPCEAN = null " + " where id <> :productId " + " and organization.id = :orgId " + " and uPCEAN = :upc "; //@formatter:on return OBDal.getInstance() .getSession() .createQuery(hql) .setParameter("productId", product.getId()) .setParameter("orgId", organization.getId()) .setParameter("upc", upcItem) .executeUpdate(); } private int deleteMultiUPCOccurrencesByProductOrg(Product product, String upcItem) { //@formatter:off String hql = "delete from obmupc_prod_multiupc " + " where product.id <> :productId " + " and upc = :upc "; //@formatter:on return OBDal.getInstance() .getSession() .createQuery(hql) .setParameter("productId", product.getId()) .setParameter("upc", upcItem) .executeUpdate(); } In these cases the event handler "UpdateMultiUpcDescHandler" is not executed. Then the EM_Obmupc_Multiupc_Desc field is out of date with incorrect values. | |||||||||||
Steps To Reproduce | From BO: Select a product "X", in the "Multi UPC" tab, add several records with different UPC: upc= 3425901109121 upc= 1234 upc= 456 2. Delete the first record with upc= 3425901109121 by database script: delete from obmupc_prod_multiupc where m_product_id='productX'; 3.Select product "Y", add from BO the following upc: upc= 3425901109121 upc= 123455 upc= 45677 From the POS: When filtering by searching for UPC 3425901109121, it first shows product "X" and when re-entering the same upc it selects product "Y", attached is a sample video. I attach an example of a process that modifies the upc and the eventhandler is not executed when this process is executed. | |||||||||||
Proposed Solution | Delete the event handler and create a trigger to be executed after an insert/update/delete in the "obmupc_prod_multiupc" table, the following query can be used to update the "EM_Obmupc_Multiupc_Desc" field of the m_product table: select coalesce(array_to_string(array_agg(upc), ','),'') into v_multiupc from obmupc_prod_multiupc where m_product_id= 'ProductoID'; update m_product set EM_Obmupc_Multiupc_Desc= v_multiupc where m_product_id='ProductoID'; | |||||||||||
Additional Information | ||||||||||||
Tags | NOR | |||||||||||
Relationships |
| |||||||||||
Attached Files | ImportProductJavaPropertyMappingHandler.java (26,530) 2021-03-26 15:33 https://issues.openbravo.com/file_download.php?file_id=15471&type=bug error.mkv (4,254,114) 2021-03-26 16:03 https://issues.openbravo.com/file_download.php?file_id=15472&type=bug | |||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2021-03-26 15:33 | lbressan | New Issue | ||||||||||
2021-03-26 15:33 | lbressan | Assigned To | => Retail | |||||||||
2021-03-26 15:33 | lbressan | File Added: ImportProductJavaPropertyMappingHandler.java | ||||||||||
2021-03-26 15:33 | lbressan | Resolution time | => 1618524000 | |||||||||
2021-03-26 15:33 | lbressan | Triggers an Emergency Pack | => No | |||||||||
2021-03-26 16:03 | lbressan | File Added: error.mkv | ||||||||||
2021-03-26 16:15 | rafaroda | Tag Attached: NOR | ||||||||||
2021-03-30 10:10 | ranjith_qualiantech_com | Assigned To | Retail => ranjith_qualiantech_com | |||||||||
2021-03-31 07:42 | hgbot | Note Added: 0127051 | ||||||||||
2021-04-07 10:50 | hgbot | Resolution | open => fixed | |||||||||
2021-04-07 10:50 | hgbot | Status | new => closed | |||||||||
2021-04-07 10:50 | hgbot | Note Added: 0127125 | ||||||||||
2021-04-07 10:50 | hgbot | Note Added: 0127126 | ||||||||||
2021-04-07 17:50 | hgbot | Note Added: 0127143 | ||||||||||
2021-04-07 17:50 | marvintm | Note Added: 0127144 | ||||||||||
2021-04-07 17:50 | marvintm | Status | closed => new | |||||||||
2021-04-07 17:50 | marvintm | Resolution | fixed => open | |||||||||
2021-04-09 12:01 | hgbot | Note Added: 0127196 | ||||||||||
2021-04-09 12:01 | hgbot | Note Added: 0127197 | ||||||||||
2021-04-09 12:01 | hgbot | Note Added: 0127198 | ||||||||||
2021-04-19 08:32 | hgbot | Resolution | open => fixed | |||||||||
2021-04-19 08:32 | hgbot | Status | new => closed | |||||||||
2021-04-19 08:32 | hgbot | Note Added: 0127360 | ||||||||||
2021-04-19 08:32 | hgbot | Note Added: 0127361 | ||||||||||
2021-04-19 08:34 | marvintm | Note Added: 0127362 | ||||||||||
2021-04-19 16:04 | hgbot | Note Added: 0127369 | ||||||||||
2021-04-19 16:04 | hgbot | Note Added: 0127370 | ||||||||||
2021-04-19 16:04 | hgbot | Note Added: 0127371 | ||||||||||
2021-04-19 16:04 | hgbot | Note Added: 0127372 | ||||||||||
2022-06-07 07:06 | alostale | Relationship added | causes 0049492 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|