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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0046167
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Multi UPC/EAN for Productmajoralways2021-03-26 15:332021-04-19 16:04
ReporterlbressanView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionRR20Q3.1SCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0046167: The "Multi UPC/EAN for Products" module does not recalculate the EM_Obmupc_Multiupc_Desc field

Descriptionhe "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 SolutionDelete 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';
TagsNOR
Attached Files? file icon ImportProductJavaPropertyMappingHandler.java [^] (26,530 bytes) 2021-03-26 15:33
? file icon error.mkv [^] (4,254,114 bytes) 2021-03-26 16:03

- Relationships Relation Graph ] Dependency Graph ]
causes defect 0049492 closedranjith_qualiantech_com cannot install org.openbravo.multiupc without retail 

-  Notes
(0127051)
hgbot (developer)
2021-03-31 07:42

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc/-/merge_requests/1 [^]
(0127125)
hgbot (developer)
2021-04-07 10:50

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc [^]
Changeset: 1a0b4707c53c10a9aedbeeb085e3657880a8d61a
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-04-07T12:59:05+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc/-/commit/1a0b4707c53c10a9aedbeeb085e3657880a8d61a [^]

Fixed ISSUE-46167: Replaced EventHandler with Trigger for updating Product UPC Desc

---
A src-db/database/model/triggers/OBMUPC_PROD_MULTIUPC_TRG.xml
R src/org/openbravo/multiupc/event/UpdateMultiUpcDescHandler.java
---
(0127126)
hgbot (developer)
2021-04-07 10:50

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc/-/merge_requests/1 [^]
(0127143)
hgbot (developer)
2021-04-07 17:50

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc [^]
Changeset: 431292835eb75e4501af6f7bc0d897efcfdd0b29
Author: Antonio Moreno <antonio.moreno@openbravo.com>
Date: 2021-04-07T15:50:05+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc/-/commit/431292835eb75e4501af6f7bc0d897efcfdd0b29 [^]

Revert "Fixed ISSUE-46167: Replaced EventHandler with Trigger for updating Product UPC Desc"

This reverts commit 1a0b4707c53c10a9aedbeeb085e3657880a8d61a
---
A src/org/openbravo/multiupc/event/UpdateMultiUpcDescHandler.java
R src-db/database/model/triggers/OBMUPC_PROD_MULTIUPC_TRG.xml
---
(0127144)
marvintm (manager)
2021-04-07 17:50

Reverted fix as it was causing problems in integration
(0127196)
hgbot (developer)
2021-04-09 12:01

Merge Request created: https://gitlab.com/openbravo/ci/modules/org.openbravo.test.mobile.sampledata/-/merge_requests/12 [^]
(0127197)
hgbot (developer)
2021-04-09 12:01

Merge Request created: https://gitlab.com/openbravo/ci/modules/org.openbravo.retail.testsampledata/-/merge_requests/9 [^]
(0127198)
hgbot (developer)
2021-04-09 12:01

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc/-/merge_requests/2 [^]
(0127360)
hgbot (developer)
2021-04-19 08:32

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc [^]
Changeset: 867ca62708d566bbe4ee0c695665df0f98e462aa
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-04-09T12:45:12+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc/-/commit/867ca62708d566bbe4ee0c695665df0f98e462aa [^]

Fixed ISSUE-46167: Added Process to update Product UPC Description
* Updated EventHandler to update Product UPC Description

---
A src-db/database/sourcedata/AD_MENU.xml
A src-db/database/sourcedata/AD_MODEL_OBJECT.xml
A src-db/database/sourcedata/AD_PROCESS.xml
A src-db/database/sourcedata/AD_PROCESS_PARA.xml
A src-db/database/sourcedata/AD_TREENODE.xml
A src/org/openbravo/multiupc/process/UpdateProductUPCDescription.java
A src/org/openbravo/multiupc/utility/MultiUPCUtils.java
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/multiupc/event/UpdateMultiUpcDescHandler.java
---
(0127361)
hgbot (developer)
2021-04-19 08:32

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.multiupc/-/merge_requests/2 [^]
(0127362)
marvintm (manager)
2021-04-19 08:34

Finally we did not create a trigger, as that was causing problems with other flows and with Oracle. Instead, we have created a process, "Update Product UPC description". This process can be used to update the UPC description of a particular assortment or all products in the system.
(0127369)
hgbot (developer)
2021-04-19 16:04

Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.retail.testsampledata [^]
Changeset: f1d99f5ed67db8c1b6fecf84c1d0fb905fda4b5b
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-04-09T11:31:59+05:30
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.retail.testsampledata/-/commit/f1d99f5ed67db8c1b6fecf84c1d0fb905fda4b5b [^]

Related to ISSUE-46167: Added ProcessAccess to Process UpdateProductUPCDesc

---
M referencedata/sampledata/Retail_Test/AD_PROCESS_ACCESS.xml
---
(0127370)
hgbot (developer)
2021-04-19 16:04

Merge request merged: https://gitlab.com/openbravo/ci/modules/org.openbravo.retail.testsampledata/-/merge_requests/9 [^]
(0127371)
hgbot (developer)
2021-04-19 16:04

Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.test.mobile.sampledata [^]
Changeset: 893ac9e1a8f1c84b6fdb900ba8073f2b52a704b4
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-04-09T11:32:25+05:30
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.test.mobile.sampledata/-/commit/893ac9e1a8f1c84b6fdb900ba8073f2b52a704b4 [^]

Related to ISSUE-46167: Added ProcessAccess to Process UpdateProductUPCDesc

---
M referencedata/sampledata/The_White_Valley_Group/AD_PROCESS_ACCESS.xml
---
(0127372)
hgbot (developer)
2021-04-19 16:04

Merge request merged: https://gitlab.com/openbravo/ci/modules/org.openbravo.test.mobile.sampledata/-/merge_requests/12 [^]

- 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker