Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0052859 | Openbravo ERP | A. Platform | public | 2023-06-27 12:51 | 2023-07-08 00:55 |
|
Reporter | AugustoMauch | |
Assigned To | AugustoMauch | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | PR23Q4 | |
Merge Request Status | approved |
Review Assigned To | |
OBNetwork customer | No |
Web browser | |
Modules | Core |
Support ticket | 65000 |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0052859: It is not possible to have computed columns both in m_product and m_offer_product |
Description | If we try to have computed columns both in the m_product and m_offer_product tables, the datasource response for both of those tables will fail.
For m_product:
- java.lang.ClassCastException: class org.openbravo.model.pricing.priceadjustment.Product_ComputedColumns$HibernateProxy$GcoEEn1j cannot be cast to class org.openbravo.model.common.plm.Product_ComputedColumns (org.openbravo.model.pricing.priceadjustment.Product_ComputedColumns$HibernateProxy$GcoEEn1j and org.openbravo.model.common.plm.Product_ComputedColumns are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @51e7ffe5)
For m_offer_product:
- org.openbravo.base.util.CheckException: Property testOffer does not exist for entity Product_ComputedColumns
The cause is that when generating the entities for the computed columns, the names of the entities are built using <className>_ComputedColumns, and the name for both m_product and m_offer_product classes is Product, resulting in two entities with the same name (Product_ComputedColumn).
|
Steps To Reproduce | - Add computed columns (and fields) to both m_product and m_offer_product. You can use the same sql logic in both of them: select m_productprice.m_productprice_id from m_productprice where m_productprice.m_product_id=m_product_id limit 1, create a String column.
- Compile the application, restart tomcat
- Open the Product window. The following error will be thrown: java.lang.ClassCastException: class org.openbravo.model.pricing.priceadjustment.Product_ComputedColumns$HibernateProxy$GcoEEn1j cannot be cast to class org.openbravo.model.common.plm.Product_ComputedColumns
- Open Discounts and Promotions, select a record, select the Products tab. The following error will be thrown: org.openbravo.base.util.CheckException: Property testOffer does not exist for entity Product_ComputedColumns
|
Proposed Solution | When building the entities of the computed column, use the entity name of the original entity as prefix (guaranteed to be unique) instead of the class name (not guaranteed) |
Additional Information | |
Tags | No tags attached. |
Relationships | has duplicate | defect | 0052606 | | closed | Triage Platform Base | Unable to create a computed column for m_offer_product table |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2023-06-27 12:51 | AugustoMauch | New Issue | |
2023-06-27 12:51 | AugustoMauch | Assigned To | => AugustoMauch |
2023-06-27 12:51 | AugustoMauch | OBNetwork customer | => No |
2023-06-27 12:51 | AugustoMauch | Modules | => Core |
2023-06-27 12:51 | AugustoMauch | Triggers an Emergency Pack | => No |
2023-06-27 12:51 | AugustoMauch | Status | new => scheduled |
2023-06-27 12:55 | hgbot | Merge Request Status | => open |
2023-06-27 12:55 | hgbot | Note Added: 0151669 | |
2023-06-27 15:08 | Practics | Issue Monitored: Practics | |
2023-06-27 18:14 | AugustoMauch | Relationship added | has duplicate 0052606 |
2023-06-27 18:14 | AugustoMauch | Support ticket | => 65000 |
2023-06-28 10:05 | AugustoMauch | Description Updated | bug_revision_view_page.php?rev_id=26366#r26366 |
2023-07-07 10:29 | hgbot | Merge Request Status | open => approved |
2023-07-08 00:53 | hgbot | Note Added: 0152202 | |
2023-07-08 00:54 | hgbot | Note Added: 0152203 | |
2023-07-08 00:54 | hgbot | Note Added: 0152204 | |
2023-07-08 00:55 | hgbot | Note Added: 0152205 | |
2023-07-08 00:55 | hgbot | Resolution | open => fixed |
2023-07-08 00:55 | hgbot | Status | scheduled => closed |
2023-07-08 00:55 | hgbot | Fixed in Version | => PR23Q4 |
2023-07-08 00:55 | hgbot | Note Added: 0152206 | |
Notes |
|
(0151669)
|
hgbot
|
2023-06-27 12:55
|
|
|
|
(0152202)
|
hgbot
|
2023-07-08 00:53
|
|
|
|
(0152203)
|
hgbot
|
2023-07-08 00:54
|
|
|
|
(0152204)
|
hgbot
|
2023-07-08 00:54
|
|
|
|
(0152205)
|
hgbot
|
2023-07-08 00:55
|
|
|
|
(0152206)
|
hgbot
|
2023-07-08 00:55
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: cc662cc2242a424fbfca16af9a9ece7292ae3968
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 07-07-2023 21:08:49
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/cc662cc2242a424fbfca16af9a9ece7292ae3968 [^]
Fixes ISSUE-52859: The name of computed columns entities are not guaranteed to be unique.
The problem is that when generating the entities for the computed columns, we names of the entities are built using <className>_ComputedColumns, and the name for both m_product and m_offer_product classes is Product, resulting in two entities with the same name (Product_ComputedColumn).
To fix it, the name of the entities generated for the computed columns, the original entity name (guaranteed to be unique) will be used as prefix instead of the class name (not guaranteed).
Note that this change is an API change due to the name of the computed column entities being updated.
---
M src/org/openbravo/base/gen/entityComputedColumns.ftl
M src/org/openbravo/base/model/Entity.java
M src/org/openbravo/dal/core/DalMappingGenerator.java
---
|
|