Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041333Openbravo ERP02. Master data managementpublic2019-07-10 15:292019-08-22 14:45
francisco 
collazoandy4 
highmajoralways
closedfixed 
5
 
3.0PR19Q4 
dmiguelez
Core
No
0041333: Duplicate values when create new Product characteristics values
Duplicate values when create new Product characteristics values
Tested in Pi:
1.- Go to the back-end and create a Product characteristic:
    - Org: F&B España - Región Norte
    - Name: Test
    - Variant = N
    - Active = Y

2.- Go to values tab for "Test"
    - Name = Test1
    - SummaryLevel = N
    - Active = Y

3.- Go to the back-end and insert again the same characteristic value
 
It is allowing to have duplicates values
- Add a trigger in m_characteristic to check the uniqueness of the values when the variant flag is enabled.

- Disallow to modify the variant flag once the characteristic has values
No tags attached.
related to defect 0040547 closed nonofrancisco m_ch_value_trg2 is not taking into account the new created register 
related to defect 0041485 closed dmiguelez API Change Request 
Issue History
2019-07-10 15:29franciscoNew Issue
2019-07-10 15:29franciscoAssigned To => Triage Finance
2019-07-10 15:29franciscoModules => Core
2019-07-10 15:29franciscoResolution time => 1564524000
2019-07-10 15:29franciscoTriggers an Emergency Pack => No
2019-07-10 15:54SandrahuguetRelationship addedrelated to 0040547
2019-07-10 15:55SandrahuguetAssigned ToTriage Finance => collazoandy4
2019-07-19 15:17collazoandy4Statusnew => scheduled
2019-07-30 12:40dmiguelezRelationship addedrelated to 0041485
2019-07-30 13:05dmiguelezNote Added: 0113705
2019-07-30 13:06hgbotCheckin
2019-07-30 13:06hgbotNote Added: 0113707
2019-07-30 13:06hgbotStatusscheduled => resolved
2019-07-30 13:06hgbotResolutionopen => fixed
2019-07-30 13:06hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1e75513925e887bb617dbba6977183c992178823 [^]
2019-07-30 16:20hgbotCheckin
2019-07-30 16:20hgbotNote Added: 0113713
2019-07-30 17:12dmiguelezReview Assigned To => dmiguelez
2019-07-30 17:12dmiguelezNote Added: 0113719
2019-07-30 17:12dmiguelezStatusresolved => closed
2019-07-30 17:12dmiguelezFixed in Version => 3.0PR19Q4
2019-07-31 09:47hgbotCheckin
2019-07-31 09:47hgbotNote Added: 0113723
2019-07-31 11:22hgbotCheckin
2019-07-31 11:22hgbotNote Added: 0113727
2019-08-07 12:28dmiguelezNote Added: 0113875
2019-08-22 14:45hudsonbotCheckin
2019-08-22 14:45hudsonbotNote Added: 0114184
2019-08-22 14:45hudsonbotCheckin
2019-08-22 14:45hudsonbotNote Added: 0114185
2019-08-22 14:45hudsonbotCheckin
2019-08-22 14:45hudsonbotNote Added: 0114213

Notes
(0113705)
dmiguelez   
2019-07-30 13:05   
Test Plan:

Log in as F&B Admin

1.Go to Product Characteristic Window and create a new record with:
    - Org: F&B España - Región Norte
    - Name: Test
    - Variant = N
    - Active = Y
Go to Values tab and create a new record with
    - Name = Test1
    - SummaryLevel = N
    - Active = Y
Try to create a new record with the same value, a message is shown:
Saving failed. There is already a Characteristic Value with the same (Characteristic, Name). (Characteristic, Name) must be unique. You must change the values entered.

2. Create another Product Characteristic named test2 with a Value named Test. It is possible to do so

3.Go to Product Characteristic Window and create a new record with:
    - Org: F&B España - Región Norte
    - Name: Test
    - Variant = Y
    - Active = Y
Go to Values tab and create a new record with
    - Name = Test1
    - SummaryLevel = N
    - Active = Y
Try to create a new record with the same value, a message is shown:
Saving failed. There is already a Characteristic Value with the same (Characteristic, Name). (Characteristic, Name) must be unique. You must change the values entered.
(0113707)
hgbot   
2019-07-30 13:06   
Repository: erp/devel/pi
Changeset: 1e75513925e887bb617dbba6977183c992178823
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Jul 30 12:46:59 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1e75513925e887bb617dbba6977183c992178823 [^]

Fixes issue 41333:Duplicate values when create Product characteristics values

If a process create product characteristic with insert sql query a duplicate product
characteristics value can be added to the database because the validation in the
Event Observer doesn't take into account while inserting.

Now a unique constraint was added to the characteristic_id and name columns and
a new build validation was created to check duplicated product characteristic values

---
M src-db/database/model/tables/M_CH_VALUE.xml
M src/org/openbravo/event/CharacteristicValueEventHandler.java
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DuplicatedCharacteristicName.class
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DuplicatedCharacteristicNameData.class
A src-util/buildvalidation/src/org/openbravo/buildvalidation/DuplicatedCharacteristicName.java
A src-util/buildvalidation/src/org/openbravo/buildvalidation/DuplicatedCharacteristicName_data.xsql
---
(0113713)
hgbot   
2019-07-30 16:20   
Repository: erp/pmods/org.openbravo.retail.sampledata
Changeset: a897052f511426110ce64da03844ba6c1af7d563
Author: Gorka Gil <gorka.gil <at> openbravo.com>
Date: Tue Jul 30 16:20:01 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.sampledata/rev/a897052f511426110ce64da03844ba6c1af7d563 [^]

Related to issue 41333: fixes wrong data in retail sampledata

---
M referencedata/sampledata/The_White_Valley_Group/AD_TREENODE.xml
M referencedata/sampledata/The_White_Valley_Group/M_CH_VALUE.xml
M referencedata/sampledata/The_White_Valley_Group/M_PRODUCT_CH_CONF.xml
---
(0113719)
dmiguelez   
2019-07-30 17:12   
Code Review + Testing Ok
(0113723)
hgbot   
2019-07-31 09:47   
Repository: erp/devel/pi
Changeset: e52c191231ee7a4e491cd53febde31170d798036
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Wed Jul 31 09:32:55 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e52c191231ee7a4e491cd53febde31170d798036 [^]

Related to Issue 41333. Modifies final Core version till which the buildvalidation
should be executed. It uses the changeset number to ensure it will work in
upgrades for Q4

---
M src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DuplicatedCharacteristicName.class
M src-util/buildvalidation/src/org/openbravo/buildvalidation/DuplicatedCharacteristicName.java
---
(0113727)
hgbot   
2019-07-31 11:22   
Repository: tools/automation/pi-mobile
Changeset: f732305db94a2e3c8d993e4642e394ac4e0fbb8e
Author: Gorka Gil <gorka.gil <at> openbravo.com>
Date: Wed Jul 31 11:22:18 2019 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/f732305db94a2e3c8d993e4642e394ac4e0fbb8e [^]

Related to issue 41333: update test of retail api with the new values

---
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/retailapi/POSProductChAndConfRequest.java
---
(0113875)
dmiguelez   
2019-08-07 12:28   
Commit related to Issue:
https://code.openbravo.com/erp/devel/pi/rev/f89790531335 [^]

Fixes problem in Build Validation when updating from an OB version in which m_ch_value table does not exist.
(0114184)
hudsonbot   
2019-08-22 14:45   
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/ad3efd3bd07c [^]
Maturity status: Test
(0114185)
hudsonbot   
2019-08-22 14:45   
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/ad3efd3bd07c [^]
Maturity status: Test
(0114213)
hudsonbot   
2019-08-22 14:45   
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/ad3efd3bd07c [^]
Maturity status: Test