Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041850Openbravo ERP09. Financial managementpublic2019-09-18 15:012019-09-19 18:28
ngarcia 
markmm82 
immediateminoralways
closedfixed 
5
 
3.0PR19Q2.33.0PR19Q2.3 
Sandrahuguet
Core
2019-05-03
3.0PR19Q3
https://code.openbravo.com/erp/devel/pi/rev/54f5cc848bee48edf56131bff6b0265e17a75a99 [^]
No
0041850: Cannot post a document if it has a customized SQL description that returns more than one record
Cannot post a document if it has a customized SQL description that returns more than one record
Install the 18Q3.5 version
As System Admin role:
   Create a new template for exporting the changes made to core
   Set as Displayed the SQL Description field of Active Tables tab of General Ledger Configuration window
   Export the changes to the template

As group admin role:
   Set the following SQL Description to the Invoice table of 'F&B EspaƱa, S.A. US/A/Euro' configuration:

select 'Order Document Number: ' || o.documentno || ' ,'
from c_order o, c_invoice i
where i.c_order_id = o.c_order_id
and i.c_invoice_id = @RecordId@
UNION
select 'Invoice Document Number: ' || documentno || ' '
from c_invoice
where c_invoice_id = @RecordId@

   Create a Sales Order:
      Document Type: POS Order
   Add a product with stock and complete it
   Go to Sales Invoice window and post the created invoice
   Check its description. It concatenates the result of the two queries

Upgrade the instance to a version which includes the fix of 40523 issue (18Q4.4, 19Q.1 or higher)

As group admin role:
   Go to Sales Invoice window and unpost the created invoice
   Try to post it and check it finishes with the following error:
      Process failed during execution
   The log shows:
org.openbravo.erpCommon.ad_forms.AcctServer - AcctServer - postCommitjavax.servlet.ServletException: @CODE=@query did not return a unique result: 2
         
No tags attached.
blocks defect 0041848 closed markmm82 Cannot post a document if it has a customized SQL description that returns more than one record 
Issue History
2019-09-18 15:39SandrahuguetTypedefect => backport
2019-09-18 15:39SandrahuguetTarget Version => 3.0PR19Q2.3
2019-09-19 18:26hgbotCheckin
2019-09-19 18:26hgbotNote Added: 0114674
2019-09-19 18:28SandrahuguetStatusscheduled => resolved
2019-09-19 18:28SandrahuguetFixed in Version => 3.0PR19Q2.3
2019-09-19 18:28SandrahuguetFixed in SCM revision => https://code.openbravo.com/erp/backports/3.0PR19Q2.3/rev/d1654ee5a5a63480995b1d74a31c7779c1227a75 [^]
2019-09-19 18:28SandrahuguetResolutionopen => fixed
2019-09-19 18:28SandrahuguetReview Assigned To => Sandrahuguet
2019-09-19 18:28SandrahuguetNote Added: 0114677
2019-09-19 18:28SandrahuguetStatusresolved => closed

Notes
(0114674)
hgbot   
2019-09-19 18:26   
Repository: erp/backports/3.0PR19Q2.3
Changeset: d1654ee5a5a63480995b1d74a31c7779c1227a75
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Wed Sep 18 21:47:53 2019 -0300
URL: http://code.openbravo.com/erp/backports/3.0PR19Q2.3/rev/d1654ee5a5a63480995b1d74a31c7779c1227a75 [^]

Fix for issue 41850: Cannot post a document if it has customized SQL description
that returns more than one record.

When the customized SQL description returned more than one record, an exception
was thrown because the query was executed expecting an unique result.

Now is executed with getResultList and all the resultant descriptions are append
to the description.

---
M src/org/openbravo/erpCommon/ad_forms/FactLine.java
---
(0114677)
Sandrahuguet   
2019-09-19 18:28   
code review + testing ok