Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040547Openbravo ERP02. Master data managementpublic2019-04-08 10:482019-05-27 13:54
kchoperena 
nonofrancisco 
highmajoralways
closedfixed 
5
 
3.0PR19Q3 
Sandrahuguet
Core
No
0040547: m_ch_value_trg2 is not taking into account the new created register
The m_ch_value_trg2 trigger allows the creation of a duplicated m_ch_value breaking the uniqueness pair (M_characteristic_id, name) related to a variant characteristic. After the insertion, the trigger blocks the creation of new characteristic values because of duplicated registers.
1.- Go to the back-end and create a product characteristic:
    - Org: F&B España - Región Norte
    - Name: TestCharacteristic
    - Variant = N
    - Use on WebPOS = Y
    - Explode configuration tab = Y
    - Filter on WebPOS = Y
    - Active = Y

2.- Go to the back-end and insert a m_ch_value related to the variant characteristic with the name 'characteristicValueName'
    - Name = Test
    - SummaryLevel = N
    - Active = Y

2.- Go to the back-end and insert again the same characteristic value
 
3.- Update the characteristic TestCharacteristic to Variant = Y

3.- Try to insert any characteristic value with a different value

EXPECTED RESULTS:

Any new insert in characteristic value table will be blocked
Change the m_ch_value_trg2 to take into account the new register
No tags attached.
related to defect 0041333 closed collazoandy4 Duplicate values when create new Product characteristics values 
diff mChValueTrg2.diff (1,354) 2019-04-08 10:48
https://issues.openbravo.com/file_download.php?file_id=12845&type=bug
Issue History
2019-04-08 10:48kchoperenaNew Issue
2019-04-08 10:48kchoperenaAssigned To => platform
2019-04-08 10:48kchoperenaFile Added: mChValueTrg2.diff
2019-04-08 10:48kchoperenaModules => Core
2019-04-08 10:48kchoperenaResolution time => 1555884000
2019-04-08 10:48kchoperenaTriggers an Emergency Pack => No
2019-04-08 10:57alostaleAssigned Toplatform => Triage Finance
2019-04-25 16:51SandrahuguetAssigned ToTriage Finance => nonofrancisco
2019-04-25 17:55SandrahuguetCategoryA. Platform => 02. Master data management
2019-04-29 17:33SandrahuguetResolution time1555884000 => 1557957600
2019-05-02 06:28nonofranciscoStatusnew => scheduled
2019-05-07 09:28kchoperenaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18722#r18722
2019-05-07 09:31kchoperenaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18723#r18723
2019-05-14 09:51kchoperenaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18763#r18763
2019-05-15 16:48nonofranciscoNote Added: 0111692
2019-05-22 08:26hgbotCheckin
2019-05-22 08:26hgbotNote Added: 0112061
2019-05-22 08:26hgbotStatusscheduled => resolved
2019-05-22 08:26hgbotResolutionopen => fixed
2019-05-22 08:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fe5a1e5fb57689ec01f42931ce3ec7405be94fc2 [^]
2019-05-22 08:32SandrahuguetReview Assigned To => Sandrahuguet
2019-05-22 08:32SandrahuguetNote Added: 0112062
2019-05-22 08:32SandrahuguetStatusresolved => closed
2019-05-22 08:32SandrahuguetFixed in Version => 3.0PR19Q3
2019-05-27 13:54hudsonbotCheckin
2019-05-27 13:54hudsonbotNote Added: 0112168
2019-07-10 15:54SandrahuguetRelationship addedrelated to 0041333

Notes
(0111692)
nonofrancisco   
2019-05-15 16:48   
Test Plan

As Openbravo/F&B International Group Admin
Open Product Characteristic window
Create a new header
  Organization: F&B España - Región Norte
  Name: TestCharacteristicA
  Variant = N
Go to Values tab
Create twoo new record with same values
  Name: ValueA
Create a new header
  Organization: F&B España - Región Norte
  Name: TestCharacteristicB
  Variant = N
Go to Values tab
Create a new record
  Name: ValueA
Select product characteristic with name TestCharacteristicA
Set Variant = true
Go to Values tab
Create a new record
  Name: ValueA
Verify an exception is thrown indicating there are duplicated values
Select product characteristic with name TestCharacteristicB
Create a new record
  Name: ValueA
Verify the operation completes successfully
(0112061)
hgbot   
2019-05-22 08:26   
Repository: erp/devel/pi
Changeset: fe5a1e5fb57689ec01f42931ce3ec7405be94fc2
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Tue May 14 13:09:53 2019 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/fe5a1e5fb57689ec01f42931ce3ec7405be94fc2 [^]

Fixes issue 40547: Check for duplicates in Event Observer

Prior this fix, duplicate values in m_ch_value were checked in a statement
level trigger, blocking insertions in some flows.

This fix removes trigger and adds logic for check duplicates in an Event
Observer, to avoid the table mutating problem in Oracle.

---
M src/org/openbravo/event/CharacteristicValueEventHandler.java
R src-db/database/model/triggers/M_CH_VALUE_TRG2.xml
---
(0112062)
Sandrahuguet   
2019-05-22 08:32   
Code review + testing ok
(0112168)
hudsonbot   
2019-05-27 13:54   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/bdad8ace6f89 [^]
Maturity status: Test