Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007618Openbravo ERP00. Application dictionarypublic2009-02-18 10:232009-04-22 00:00
Dowid 
shuehner 
highminorhave not tried
closedfixed 
10SP2
pi 
2.50beta 
Core
No
0007618: AD_MESSAGE with the search key that matches constraint name doesn't work in Postgres
Application Dictionary->Message
 
When creating an error message that is related to a contraint in the database, the OBError displays this message in Oracle but does not display the message in Postgres.
1. Go to Application Dictionary->Message
2. Search meassage with Search key "AD_USER_UN_USERNAME". Message related to thise constraint "Already exists a user with the same User name . Input a different one"

3. Test this message in Oracle and Postgres. Please follow steps in [1]

Note that this message is displayed correctly in Oracle, and incorrectly in Postgres. Furthermore, this behavior is true for all errors that are related to contraints in the Postgres, but works in Oracle.
 

[1] https://issues.openbravo.com/view.php?id=6989 [^]
No tags attached.
depends on backport 0007729 closed shuehner AD_MESSAGE with the search key that matches constraint name doesn't work in Postgres 
related to defect 0005625 closed shuehner Improve messaging where there is no conversion rate 
blocks defect 0006989pi closed Dowid Duplicate user error message should be displayed in correct context 
blocks feature request 0002695 closed Dowid Message when creating duplicate File Formats is not clear 
Issue History
2009-02-18 10:23DowidNew Issue
2009-02-18 10:23DowidAssigned To => rafaroda
2009-02-18 10:23DowidRegression testing => No
2009-02-18 10:24DowidRelationship addedblocks 0006989
2009-02-18 10:25DowidRelationship addedblocks 0002695
2009-02-18 11:32rafarodaNote Added: 0013632
2009-02-18 11:32rafarodaStatusnew => feedback
2009-02-18 13:19DowidNote Added: 0013646
2009-02-18 13:32DowidNote Edited: 0013646
2009-02-18 18:21rafarodaNote Added: 0013689
2009-02-18 18:21rafarodaAssigned Torafaroda => shuehner
2009-02-18 18:21rafarodaPrioritynormal => high
2009-02-18 18:21rafarodaStatusfeedback => scheduled
2009-02-18 18:25shuehnerRelationship addedrelated to 0005625
2009-02-18 20:22shuehnerNote Added: 0013700
2009-02-20 17:29shuehnerStatusscheduled => acknowledged
2009-02-20 17:29shuehnerStatusacknowledged => scheduled
2009-02-20 17:29shuehnerfix_in_branch => trunk
2009-02-20 17:33svnbotCheckin
2009-02-20 17:33svnbotNote Added: 0013860
2009-02-20 17:33svnbotStatusscheduled => resolved
2009-02-20 17:33svnbotResolutionopen => fixed
2009-02-20 17:33svnbotsvn_revision => 13482
2009-04-21 10:33psarobeStatusresolved => closed
2009-04-22 00:00anonymoussf_bug_id0 => 2777923

Notes
(0013632)
rafaroda   
2009-02-18 11:32   
Hi David,

I do not agree with what you say.
1) Go to 'Project & Service Management || Transactions || Expense Sheet' and create a new expense.
2) Go to Lines tab and tick Reinvoicing check WITHOUT selecting a business partner.
3) Save.
      
Error message displays: "You have checked Reinvoicing. You must also select the corresponding Business Partner."

This message is displaying correctly in PostgreSQL and is defined in AD_MESSAGE through a constraint name: "S_TIMEEXPENSELINE_CHECK1"

select * from ad_message where msgtext like '%You have checked Reinvoicing%';
(0013646)
Dowid   
2009-02-18 13:19   
(edited on: 2009-02-18 13:32)
Rafa,

What I meant was constraints that have unique type. Your example is related to the check type constraint. For contraints with the check type it works, but for unique constraint type we get incorrect behavior in Postgres.

By executing this select you will be able to see these constraints:

Select pgc.conname, m.msgtext from pg_constraint pgc , AD_Message m
where pgc.contype ='u'
and Upper(m."value") like Upper(pgc.conname)

(0013689)
rafaroda   
2009-02-18 18:21   
Thank you for the clarification David.
(0013700)
shuehner   
2009-02-18 20:22   
This problem does happen for the following constraint types:

- unique, and primary key (unique implicitely)

The following constraint types are ok:

- check constraint
- foreign key
- not null
(0013860)
svnbot   
2009-02-20 17:33   
Repository: openbravo
Revision: 13482
Author: huehner
Date: 2009-02-20 17:32:58 +0100 (Fri, 20 Feb 2009)

Fixed 7618
Fix parsing of postgres error messages so that ad_message entries for a specific
constraint violation are correctly found

---
U trunk/src/org/openbravo/erpCommon/utility/ErrorTextParserPOSTGRE.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=13482&sc=1 [^]