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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0042267
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] 02. Master data managementmajoralways2019-11-13 11:312020-01-02 16:28
ReporterguillermogilView Statuspublic 
Assigned Toinigo_lerga 
PrioritynormalResolutionfixedFixed in Version3.0PR20Q1
StatusclosedFix in branchFixed in SCM revision09d12ac7b19a
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0042267: M_Product has a wrong constraint

Descriptionm_product_value should be changed by a trigger that checks that the value is not duplicated on the same legal entity.

It will be needed to review also if some index is needed as the unique will be removed.
Steps To ReproduceN/A
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0115573)
vmromanos (manager)
2019-11-13 12:38
edited on: 2019-11-13 12:45

Important: this would create an important API change and could have performance implications as the associated index won't be available anymore.

Other master data, like Product Category, Business Partner, etc. should be reviewed as well to implement the same logic.


Do NOT work on this until Dmitry's approval.

(0115743)
vmromanos (manager)
2019-11-21 10:57

Finally we will implement the following:

1. In Core, to relax current unique constraint [Client, Value] by [Value, Organization], so the same product's search key can be shared between several organizations.
Note adding Client column doesn't add any value thanks to UUIDs.

Important: this will create an API change. Any code that is expecting a unique product's search key per client would start failing after relaxing the unique constraint. The risk of this API change is "medium" because it's very difficult to detect this scenario in the code, and the possible failure would happen in runtime only.

2. Review the unique constraint in other master data entities to follow the same approach.
Candidates: Business Partner, Business Partner Category, Product, Product Category and PriceList.

3. Create a new module, that can be optionally installed, to add an EventObserver to restrict the searchkey duplication within the legal entity tree.
(0115861)
inigo_lerga (reporter)
2019-11-27 08:20

It is needed to add the Client into the unique constraint to avoid the following case:
An Openbravo installation that contains more than one client could not have, for example, one product each with the same search key, even though they would be separate clients inside Openbravo and there is no need for them to be related.

For this reason, the new constraints will be as follows: [Value, Organization, Client]
(0115945)
inigo_lerga (reporter)
2019-11-28 15:13

Test Plan for Product:
As the F&B International Group Admin role:
    - Go to the Product Window.
    - Create a new record inserting "1" as SearchKey,
      "F&B España - Región Sur" as Organization and
      any name you prefer. Save the record.
    - Create another record inserting "1" as SearchKey,
      "F&B España - Región Norte" as Organization and
      any name you prefer. Save the record.
      #Apreciate that an error message is thrown as the
      two Organizations used have the same Legal Entity
      above them#
    - Change the SearchKey to a different value such as "2".
      #Apreciate that this time no error is shown and
      the record has been succesfully saved#
    - Modify the SearchKey of this same record to "1" again
      and save the record.
      #Apreciate that the same error as before is shown when
      modifying a record with the same SearchKey as another
      pre-existing one#

Test Plan for Product Category:
As the F&B International Group Admin role:
    - Go to the Product Category Window.
    - Create a new record inserting "1" as SearchKey,
      "F&B España - Región Sur" as Organization and
      any name you prefer. Save the record.
    - Create another record inserting "1" as SearchKey,
      "F&B España - Región Norte" as Organization and
      any name you prefer. Save the record.
      #Apreciate that an error message is thrown as the
      two Organizations used have the same Legal Entity
      above them#
    - Change the SearchKey to a different value such as "2".
      #Apreciate that this time no error is shown and
      the record has been succesfully saved#
    - Modify the SearchKey of this same record to "1" again
      and save the record.
      #Apreciate that the same error as before is shown when
      modifying a record with the same SearchKey as another
      pre-existing one#

Test Plan for Business Partner:
As the F&B International Group Admin role:
    - Go to the Business Partner Window.
    - Create a new record inserting "1" as SearchKey,
      "F&B España - Región Sur" as Organization and
      any commercial name and business partner category
      you prefer. Save the record.
    - Create another record inserting "1" as SearchKey,
      "F&B España - Región Norte" as Organization and
      any commercial name and business partner category
      you prefer. Save the record.
      #Apreciate that an error message is thrown as the
      two Organizations used have the same Legal Entity
      above them#
    - Change the SearchKey to a different value such as "2".
      #Apreciate that this time no error is shown and
      the record has been succesfully saved#
    - Modify the SearchKey of this same record to "1" again
      and save the record.
      #Apreciate that the same error as before is shown when
      modifying a record with the same SearchKey as another
      pre-existing one#

Test Plan for Business Partner Category:
As the F&B International Group Admin role:
    - Go to the Business Partner Category Window.
    - Create a new record inserting "1" as SearchKey,
      "F&B España - Región Sur" as Organization and
      any name you prefer. Save the record.
    - Create another record inserting "1" as SearchKey,
      "F&B España - Región Norte" as Organization and
      any name you prefer. Save the record.
      #Apreciate that an error message is thrown as the
      two Organizations used have the same Legal Entity
      above them#
    - Change the SearchKey to a different value such as "2".
      #Apreciate that this time no error is shown and
      the record has been succesfully saved#
    - Modify the SearchKey of this same record to "1" again
      and save the record.
      #Apreciate that the same error as before is shown when
      modifying a record with the same SearchKey as another
      pre-existing one#

Test Plan for Price List:
As the F&B International Group Admin role:
    - Go to the Price List Window.
    - Create a new record inserting "1" as Name,
      "F&B España - Región Sur" as Organization and
      any currency you prefer. Save the record.
    - Create another record inserting "1" as Name,
      "F&B España - Región Norte" as Organization and
      any currency you prefer. Save the record.
      #Apreciate that an error message is thrown as the
      two Organizations used have the same Legal Entity
      above them#
    - Change the Name to a different value such as "2".
      #Apreciate that this time no error is shown and
      the record has been succesfully saved#
    - Modify the Name of this same record to "1" again
      and save the record.
      #Apreciate that the same error as before is shown when
      modifying a record with the same Name as another
      pre-existing one#
(0116382)
hgbot (developer)
2019-12-17 17:07

Repository: erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity
Changeset: 27f0978b9edfb33f0beb507054ab41e06bb2b1e5
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Tue Dec 17 17:03:49 2019 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity/rev/27f0978b9edfb33f0beb507054ab41e06bb2b1e5 [^]

Related to Issue 42267: Relax constraints and EventHandler added

Relax current unique constraints in Search Keys (or name
in PriceLists) for Business Partner, Business Partner
Category, Product, Product Category and PriceList.
Also an EventHandler is added to restrict search keys
(or name in PriceLists) inside the same Legal Entity or
branch in the hierarchy.
Automated Tests for the EventHandler are provided too.

---

---
(0116429)
hgbot (developer)
2019-12-19 12:59

Repository: erp/devel/pi
Changeset: 43fc4c5ce2502f094ab843198c486908c2623b97
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Dec 19 12:59:07 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/43fc4c5ce2502f094ab843198c486908c2623b97 [^]

Related to Issue 42267: Relaxation of Unique constraint

Relax current unique constraint in Search Keys for Product

---
M src-db/database/model/tables/M_PRODUCT.xml
---
(0116440)
hudsonbot (developer)
2019-12-19 18:27

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/49eee5eb07a1 [^]
Maturity status: Test
(0116556)
hgbot (developer)
2019-12-27 12:43

Repository: erp/devel/pi
Changeset: 09d12ac7b19abe656c145d7b1806f7ae2b80663e
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Tue Nov 26 16:41:01 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/09d12ac7b19abe656c145d7b1806f7ae2b80663e [^]

Fixes BUG-42267: Relaxation of Unique constraints

Relax current unique constraints in Search Keys for
Business Partner, Business Partner Category,
Product Category and PriceList.

---
M src-db/database/model/tables/C_BPARTNER.xml
M src-db/database/model/tables/C_BP_GROUP.xml
M src-db/database/model/tables/M_PRICELIST.xml
M src-db/database/model/tables/M_PRODUCT_CATEGORY.xml
---
(0116557)
aferraz (manager)
2019-12-27 12:45

Code review OK
(0116560)
hgbot (developer)
2019-12-27 14:08

Repository: erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity
Changeset: 9775fefd4409f8e835b8cdac168f3fd2025ff487
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Fri Dec 27 14:03:23 2019 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity/rev/9775fefd4409f8e835b8cdac168f3fd2025ff487 [^]

Related to Issue 42267: Code Review improvements applied

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODULE.xml
M src-test/org/openbravo/masterdata/uniqueconstraintbylegalentity/test/UCEventObserverTest.java
M src-test/org/openbravo/masterdata/uniqueconstraintbylegalentity/test/UCEventObserverTestData.java
M src/org/openbravo/masterdata/uniqueconstraintbylegalentity/event/UC_EventObserver.java
---
(0116562)
hgbot (developer)
2019-12-27 14:33

Repository: erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity
Changeset: 8427b801918109a940cd254cfda22dca9dc931e0
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Fri Dec 27 14:33:02 2019 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity/rev/8427b801918109a940cd254cfda22dca9dc931e0 [^]

Related to Issue 42267: User Interface Application dependency erased.

---
M src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
---
(0116563)
hgbot (developer)
2019-12-27 14:56

Repository: erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity
Changeset: 3207713b59d7af81e57a673dcb5ba06ace30c698
Author: Iñigo Lerga <inigo.lerga <at> openbravo.com>
Date: Fri Dec 27 14:56:08 2019 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.masterdata.uniqueconstraintbylegalentity/rev/3207713b59d7af81e57a673dcb5ba06ace30c698 [^]

Related to Issue 42267: Renamed files and TestSuite added

---
A src-test/org/openbravo/masterdata/uniqueconstraintbylegalentity/test/OBMUCLEEventObserverTest.java
A src-test/org/openbravo/masterdata/uniqueconstraintbylegalentity/test/OBMUCLEEventObserverTestData.java
A src-test/org/openbravo/masterdata/uniqueconstraintbylegalentity/test/OBMUCLEEventObserverTestSuite.java
A src/org/openbravo/masterdata/uniqueconstraintbylegalentity/event/OBMUCLEEventObserver.java
R src-test/org/openbravo/masterdata/uniqueconstraintbylegalentity/test/UCEventObserverTest.java
R src-test/org/openbravo/masterdata/uniqueconstraintbylegalentity/test/UCEventObserverTestData.java
R src/org/openbravo/masterdata/uniqueconstraintbylegalentity/event/UC_EventObserver.java
---
(0116610)
inigo_lerga (reporter)
2020-01-02 16:28

Documentation can be found in:
http://wiki.openbravo.com/wiki/Modules:Unique_Constraint_By_Legal_Entity#Introduction [^]

- Issue History
Date Modified Username Field Change
2019-11-13 11:31 guillermogil New Issue
2019-11-13 11:31 guillermogil Assigned To => Triage Finance
2019-11-13 11:31 guillermogil Modules => Core
2019-11-13 11:31 guillermogil Resolution time => 1575586800
2019-11-13 11:31 guillermogil Triggers an Emergency Pack => No
2019-11-13 11:33 guillermogil Description Updated View Revisions
2019-11-13 12:38 vmromanos Note Added: 0115573
2019-11-13 12:38 vmromanos Status new => acknowledged
2019-11-13 12:45 vmromanos Note Edited: 0115573 View Revisions
2019-11-21 10:57 vmromanos Note Added: 0115743
2019-11-21 10:58 vmromanos Assigned To Triage Finance => inigo_lerga
2019-11-21 10:58 vmromanos Status acknowledged => scheduled
2019-11-21 10:58 vmromanos Type defect => feature request
2019-11-27 08:20 inigo_lerga Note Added: 0115861
2019-11-28 15:13 inigo_lerga Note Added: 0115945
2019-12-17 17:07 hgbot Checkin
2019-12-17 17:07 hgbot Note Added: 0116382
2019-12-19 12:59 hgbot Checkin
2019-12-19 12:59 hgbot Note Added: 0116429
2019-12-19 18:27 hudsonbot Checkin
2019-12-19 18:27 hudsonbot Note Added: 0116440
2019-12-27 12:43 hgbot Checkin
2019-12-27 12:43 hgbot Note Added: 0116556
2019-12-27 12:43 hgbot Status scheduled => resolved
2019-12-27 12:43 hgbot Resolution open => fixed
2019-12-27 12:43 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/09d12ac7b19abe656c145d7b1806f7ae2b80663e [^]
2019-12-27 12:45 aferraz Review Assigned To => aferraz
2019-12-27 12:45 aferraz Note Added: 0116557
2019-12-27 12:45 aferraz Status resolved => closed
2019-12-27 12:45 aferraz Fixed in Version => 3.0PR20Q1
2019-12-27 14:08 hgbot Checkin
2019-12-27 14:08 hgbot Note Added: 0116560
2019-12-27 14:33 hgbot Checkin
2019-12-27 14:33 hgbot Note Added: 0116562
2019-12-27 14:56 hgbot Checkin
2019-12-27 14:56 hgbot Note Added: 0116563
2020-01-02 16:28 inigo_lerga Note Added: 0116610


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker