Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0055021Openbravo ERP02. Master data managementpublic2024-03-20 20:572024-05-13 08:56
sdossantos 
gonzalo_fernandez 
normalminoralways
closedfixed 
5
 
PR24Q3 
Core
No
0055021: Error with computed image column
If I create a computed image column, an error is generated. When a modification is performed, the RemoveImagesEventHandler event is triggered and it tries to recover a property that does not exist in the database, returning an error.

The problem is that the ModelProvider is uploading all the ADImage properties without taking into account whether they are computed or not.
1- Create a computed column in c_orderline to see the product image. Example:

(select m_product.ad_image_id
from m_product
where m_product.m_product_id = M_product_ID)

Use it creating a field for the Sales Order window and opening it (you would see the error).
--- a/src/org/openbravo/base/model/ModelProvider.java 2022-03-01 14:20:59.000000000 +0100
+++ b/src/org/openbravo/base/model/ModelProvider.java 2024-03-20 11:53:19.183266000 +0100
@@ -338,8 +338,10 @@
           if (p.getReferencedProperty() != null) {
             Entity referencedEntity = p.getReferencedProperty().getEntity();
             if ("ADImage".equals(referencedEntity.getName())) {
- entitiesWithImage.computeIfAbsent(p.getEntity(), k -> new ArrayList<>())
- .add(p.getName());
+ if (!p.isComputedColumn()) {
+ entitiesWithImage.computeIfAbsent(p.getEntity(), k -> new ArrayList<>())
+ .add(p.getName());
+ }
             } else if ("OBPRF_FILE".equals(referencedEntity.getName())) {
               entitiesWithFile.computeIfAbsent(p.getEntity(), k -> new ArrayList<>())
                   .add(p.getName());
No tags attached.
Issue History
2024-03-20 20:57sdossantosNew Issue
2024-03-20 20:57sdossantosAssigned To => Triage Omni OMS
2024-03-20 20:57sdossantosModules => Core
2024-03-20 20:57sdossantosTriggers an Emergency Pack => No
2024-03-20 21:03PracticsIssue Monitored: Practics
2024-03-21 10:56aferrazAssigned ToTriage Omni OMS => Triage Platform Base
2024-04-10 09:15AugustoMauchNote Added: 0163008
2024-04-10 09:15AugustoMauchStatusnew => feedback
2024-04-24 09:58AugustoMauchAssigned ToTriage Platform Base => gonzalo_fernandez
2024-04-24 13:38hgbotNote Added: 0163658
2024-04-24 14:04gonzalo_fernandezStatusfeedback => scheduled
2024-04-24 14:04gonzalo_fernandezSummaryError with computed image field => Error with computed image column
2024-04-24 14:04gonzalo_fernandezDescription Updatedbug_revision_view_page.php?rev_id=27866#r27866
2024-04-24 14:04gonzalo_fernandezSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=27868#r27868
2024-05-13 08:56hgbotResolutionopen => fixed
2024-05-13 08:56hgbotStatusscheduled => closed
2024-05-13 08:56hgbotFixed in Version => PR24Q3
2024-05-13 08:56hgbotNote Added: 0164466
2024-05-13 08:56hgbotNote Added: 0164467

Notes
(0163008)
AugustoMauch   
2024-04-10 09:15   
Hello, could you rephrase a little the steps to reproduce? "And use it - you can see the error" -> I would like to know what do you mean by "use it", and it would be useful if you could paste the error message
(0163658)
hgbot   
2024-04-24 13:38   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1214 [^]
(0164466)
hgbot   
2024-05-13 08:56   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: f0236164ac15b8eceff1f9a7aa11a41b03735827
Author: Gonzalo Fernández García <gonzalo.fernandez@openbravo.com>
Date: 13-05-2024 06:55:41
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/f0236164ac15b8eceff1f9a7aa11a41b03735827 [^]

Fixes ISSUE-55021: Fixes error when working with computed image columns

---
M src/org/openbravo/base/model/ModelProvider.java
---
(0164467)
hgbot   
2024-05-13 08:56   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1214 [^]