Openbravo Issue Tracking System - Retail Modules
View Issue Details
0057216Retail ModulesRetail Configurationpublic2024-11-20 18:012024-11-21 12:14
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
 
RR25Q1 
No
0057216: Check constraint renaming broken custom AD_MESSAGE associated to it
Back in 2019 the check-constraint
EM_OBRETCO_AVAILABLECROSSS_CHK
was renamed to be
EM_OBRETCO_AVAILABLECROSS

https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.config/-/commit/caf5670d148cc660f507214f45c3c4c929159023#232157b5d7a7d690e3aa00678be197d1a23a0e3b_8_8 [^]

But we missed hidden api of having an AD_MESSAGE with VALUE matching name of the check constraint.
So since then the custom error message for it is no longer shown
https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.config/-/blob/master/src-db/database/sourcedata/AD_MESSAGE.xml?ref_type=heads#L44 [^]
Search for EM_OBRETCO_AVAILABLECROSSS_CHK and do not find any usage for it
Find the check constraint rename linked in description noticing it missed to rename the message also

functional case for reproducer:
- as system admin role
- Go to window Inventory status
- Insert a new row
  with Available=N

Error message in UI is:
Saving failed. There is a constraint defined that was not satisfied. Please check the data entered

and openbravo.log shows technical error to be:
ERROR: new row for relation "m_inventorystatus" violates check constraint "em_obretco_availablecross"

When message should be:
Saving failed. Inventory Status can't be Available for Cross Store if it is not Available
Rename the ad_message.value to match the new check constraint.
No tags attached.
blocks feature request 0057210 new Triage Platform Base Openbravo ERP Move content of org.openbravo.retail.config module to backoffice/core repo 
Issue History
2024-11-20 18:01shuehnerNew Issue
2024-11-20 18:01shuehnerAssigned To => Retail
2024-11-20 18:01shuehnerTriggers an Emergency Pack => No
2024-11-20 18:01shuehnerAssigned ToRetail => shuehner
2024-11-20 18:01shuehnerRelationship addedblocks 0057210
2024-11-20 18:15shuehnerSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=28805#r28805
2024-11-20 18:16shuehnerDescription Updatedbug_revision_view_page.php?rev_id=28807#r28807
2024-11-20 18:20hgbotNote Added: 0172366
2024-11-20 18:20hgbotNote Added: 0172367
2024-11-21 12:14hgbotNote Added: 0172388
2024-11-21 12:14hgbotNote Added: 0172389
2024-11-21 12:14hgbotResolutionopen => fixed
2024-11-21 12:14hgbotStatusnew => closed
2024-11-21 12:14hgbotNote Added: 0172390
2024-11-21 12:14hgbotFixed in Version => RR25Q1
2024-11-21 12:14hgbotNote Added: 0172391

Notes
(0172366)
hgbot   
2024-11-20 18:20   
Merge Request created: https://gitlab.com/openbravo/ci/mobile-api/-/merge_requests/32 [^]
(0172367)
hgbot   
2024-11-20 18:20   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.config/-/merge_requests/34 [^]
(0172388)
hgbot   
2024-11-21 12:14   
Merge request merged: https://gitlab.com/openbravo/ci/mobile-api/-/merge_requests/32 [^]
(0172389)
hgbot   
2024-11-21 12:14   
Repository: https://gitlab.com/openbravo/ci/mobile-api [^]
Changeset: 4a9f5b499dd1405693f161840be1dc879c426748
Author: Stefan Huehner <s.huehner@orisha.com>
Date: 20-11-2024 18:18:28
URL: https://gitlab.com/openbravo/ci/mobile-api/-/commit/4a9f5b499dd1405693f161840be1dc879c426748 [^]

ISSUE-57216: Accept API change

---
M model/modules/org.openbravo.retail.config/src-db/database/sourcedata/AD_MESSAGE.xml
---
(0172390)
hgbot   
2024-11-21 12:14   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.config/-/merge_requests/34 [^]
(0172391)
hgbot   
2024-11-21 12:14   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.config [^]
Changeset: 5ad1f05e38d7203d73e79fe211eccd3a381087a9
Author: Stefan Huehner <s.huehner@orisha.com>
Date: 20-11-2024 18:17:06
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.config/-/commit/5ad1f05e38d7203d73e79fe211eccd3a381087a9 [^]

Fixes ISSUE-57216: Fix ad_message.value after constraint renaming

This commit from 2019 renamed a check constraint on m_inventorystatus
table.
But it missed to also rename the associated custom error message in
AD_MESSAGE table (automatically used if name matches).

Rename the message to match the constraint name again.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
---