Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0057902Openbravo ERPA. Platformpublic2025-02-07 08:372025-03-05 11:00
SABARINATH P 
meriem_azaf 
normaltrivialsometimes
feedbackopen 
5
 
 
No
Core
No
0057902: Display Logic not working properly in some cases.
When we create a sub tab(level 2) to a tab(level 1), the display logic to the sub tab(level 2) was not working properly when the SQL logic is not related to the same window.
I created a new tab in the Cashup History window, which is a child of the Channel Touchpoint window. Additionally, I added a new column in the Organization table. The tab should be displayed based on a specific condition in the Organization table. Currently, only one organization satisfies this condition.

To implement this, I created an auxiliary input with the following SQL query:

@SQL=SELECT CASE WHEN COUNT(*) > 0 THEN 'Y' ELSE 'N' END
FROM ad_org
WHERE ad_org_id = @AD_Org_ID@
AND EM_Obpos2_Cr_Sales_Pay = 'PO'

This auxiliary input is linked to the main Channel Touchpoint window and applied to the newly created tab.

While this setup generally works, I encountered an issue where the tab fails to display under certain conditions. Specifically, when there are existing records in Cashup History, the validation does not function as expected, causing the tab to not appear.

Steps to reproduce:

* There is a column(field) in the organization window "Sales on Credit and Credits Paid Display on Cash Up"
* Then there is a sub tab(level 2) "Sales on Credit" and "Credit Paid" in the cashup history of Channel touchpoint.

* Go to system admin role
* Go to auxilary input window
* Fill the details
   - Module: WebPos2
   - Tab: Touchpoint - Channel - Touchpoint
   - Name: OBPOS2_SalesOnCreditPayment
   - Validation code: @SQL=SELECT CASE WHEN COUNT(*) > 0 THEN 'Y' ELSE 'N' END FROM ad_org WHERE ad_org_id = @AD_Org_ID@ AND EM_Obpos2_Cr_Sales_Pay = 'PO'

Note: This query is used for the display logic(When the "Sales on Credit and Credits Paid Display on Cash Up" for the selected touchpoint's Organization is "Per Order" both tabs "Sales On Credit" and "Credit Paid" should be displayed. If the selected touchpoint's organization has "Sales on Credit and Credits Paid Display on Cash Up" as "Never" the tabs should not be shown. This is the logic.)

* Go to Windows tabs and fields.
* Select Channel-touchpoint and go to "Sales on Credit" tab.
* Write a display logic and use the above auxilary validation
   - @OBPOS2_SalesOnCreditPayment@='Y'
* Use the same display logic to "Credit Paid" tab too.


* Go to White valley group admin role
* Go to Organization window
* In vallblanca Org -> Go to "Sales on Credit and Credits Paid Display on Cash Up" and change the value as "Per Order"

So, Now with that display logic, the should be shown -> OK

* Go to Channel Touchpoint window
* Select the touchpoint "LAYVBS-1" which is Vallblanca organization.
* Go to cashup history and see the sub tab "Sales On Credit" and "Paid Credit" displayed -> OK
* With the selection, means we now can able to view the 3 tab level at single view (level 0,1,2)
* Now in the view itself, select the channel touchpoint MPL1 (which is Multi Price Store Organization) and now see the "Sales On Credit" and "Paid Credit" will not be displayed -> OK
* Now switch back to "LAYVBS-1" and now the tabs are again Displayed -> OK
* Now select the touchpoint "CTS1" (which is Category tree store org) and now the tab will not be displayed -> OK
* Now again swith back to "LAYVBS-1" and now see the tabs are not displayed -> KO

The diplay logic was not properly work there. I checked the entity tree. Both Vallblanca, Multi Price Store and Category Tree store org are under white valley group spain. Refer the video attached below.

https://drive.google.com/file/d/12u8x4U_aca6kpRHzCFmKKp4Diuagb6C8/view?usp=drive_link [^]
No tags attached.
diff displayLogic.diff (3,384) 2025-03-05 10:56
https://issues.openbravo.com/file_download.php?file_id=21003&type=bug
Issue History
2025-02-07 08:37SABARINATH PNew Issue
2025-02-07 08:37SABARINATH PAssigned To => migueldejuana
2025-02-07 08:37SABARINATH POBNetwork customer => No
2025-02-07 08:37SABARINATH PModules => Core
2025-02-07 08:37SABARINATH PTriggers an Emergency Pack => No
2025-02-07 08:40migueldejuanaAssigned Tomigueldejuana => Triage Platform Base
2025-02-07 08:42SABARINATH PSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=29224#r29224
2025-03-03 09:11AugustoMauchAssigned ToTriage Platform Base => meriem_azaf
2025-03-04 20:57AugustoMauchNote Added: 0176451
2025-03-04 20:57AugustoMauchStatusnew => feedback
2025-03-05 06:34SABARINATH PSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=29301#r29301
2025-03-05 10:56meriem_azafFile Added: displayLogic.diff
2025-03-05 11:00meriem_azafNote Added: 0176468
2025-03-05 11:00meriem_azafNote Edited: 0176468bug_revision_view_page.php?bugnote_id=0176468#r29303

Notes
(0176451)
AugustoMauch   
2025-03-04 20:57   
Sabarinath,

Could you provide better steps to reproduce? With the one you provided we are struggling to reproduce the issue.

Could you attach the diff of the changes you installed to reproduce the issue?
(0176468)
meriem_azaf   
2025-03-05 11:00   
I put a diff file with the changes but with it you should also do this small change:
* Go to White valley group admin role
* Go to Organization window
* In vallblanca Org -> Go to "Sales on Credit and Credits Paid Display on Cash Up" and change the value as "Per Order"