Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043581
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 03. Procurement managementmajoralways2020-03-25 21:292020-03-31 13:14
ReporterlbressanView Statuspublic 
Assigned Tovmromanos 
PrioritynormalResolutionfixedFixed in Version
StatusresolvedFix in branchFixed in SCM revisionca7ef98a3db9
ProjectionnoneETAnoneTarget Version3.0PR20Q4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todmiguelez
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0043581: selector "Create lines from Order" in "Purchase Invoice" does not show trigger's errors.

DescriptionWhen throwing an exception from a trigger (Example: RAISE EXCEPTION '%', '@ErrorMessage@'; --OBTG:-20000--) the error message is not shown in the selector.
Steps To Reproduce1 - Create a trigger in the invoice line table with a single line where an exception is thrown, example RAISE EXCEPTION '%', '@SomeErrorMessage@'; --OBTG:-20000--
2 - Create a Purchase Invoice header.
3 - Create lines using the selector "Create lines from Order"

Error message is not displayed on selector (see attached image)
TagsNo tags attached.
Attached Filespng file icon CreateLinesFromOrder.PNG [^] (15,400 bytes) 2020-03-25 21:29


diff file icon 43581_proposal.diff [^] (1,726 bytes) 2020-03-30 14:07 [Show Content]
diff file icon patch_to_force_trigger_exception.diff [^] (597 bytes) 2020-03-31 13:05 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0043608 newplatform selector "Create lines from Order" in "Purchase Invoice" does not show trigger's errors. 

-  Notes
(0118875)
vmromanos (developer)
2020-03-30 14:02
edited on: 2020-03-31 13:00

Cloned to 0043608 and assigned to Platform as I think it is a generic problem.

However, I keep opened this issue to allow the Create Lines From to properly show the exception's message raised from the trigger, as right now it won't work.

(0118890)
vmromanos (developer)
2020-03-31 13:04
edited on: 2020-03-31 13:04

Test plan I:
Login as F&B group admin
Go to Purchase Invoice window and create a new record for "Norte" organization and "Bebidas Alegres" business partner.
Press Create Lines From Order.
Select any line. Press Done.
Verify the process is completed successfully and the line has been inserted in the invoice Lines tab.


Test plan II:
Login as F&B group admin
Go to Purchase Invoice window and create a new record for "Norte" organization and "Bebidas Alegres" business partner.
Press Create Lines From Order.
Do not select any line. Press Done
Verify the error is shown in the message bar: "There are not lines selected."


Test plan III:
Apply the attached patch.
Login as F&B group admin
Go to Purchase Invoice window and create a new record for "Norte" organization and "Bebidas Alegres" business partner.
Press Create Lines From Order.
Select any line. Press Done.
Verify the error is shown in the message bar: "ERROR: The invoice line of a re-activated invoice that is linked to a Landed Cost cannot be modified. Where: función PL/pgSQL c_invoiceline_trg() en la línea 34 en RAISE"

(0118892)
hgbot (developer)
2020-03-31 13:10

Repository: erp/devel/pi
Changeset: ca7ef98a3db96f7ed94083b57a9efbcb31fdbfae
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Mar 31 12:58:39 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ca7ef98a3db96f7ed94083b57a9efbcb31fdbfae [^]

fixed BUG-43581: Create Lines From support for trigger exceptions

In case of errors during the process we rollback and close the current transaction. This is a general improvement that makes sense to the process.

In the JSONObject returned to the UI in case of exceptions, we try to get the message text to display to the end user. This is only possible because the previous locked transaction is closed, so DAL opens a new one to retrieve the error message.

Note that this code works for both db and java exceptions

---
M src/org/openbravo/common/actionhandler/createlinesfromprocess/CreateInvoiceLinesFromHandler.java
M src/org/openbravo/common/actionhandler/createlinesfromprocess/CreateInvoiceLinesFromProcess.java
---

- Issue History
Date Modified Username Field Change
2020-03-25 21:29 lbressan New Issue
2020-03-25 21:29 lbressan Assigned To => Triage Finance
2020-03-25 21:29 lbressan File Added: CreateLinesFromOrder.PNG
2020-03-25 21:29 lbressan Modules => Core
2020-03-25 21:29 lbressan Triggers an Emergency Pack => No
2020-03-25 22:04 Practics Issue Monitored: Practics
2020-03-27 08:49 inigo_lerga Assigned To Triage Finance => inigo_lerga
2020-03-27 08:49 inigo_lerga Status new => scheduled
2020-03-30 13:34 vmromanos Issue cloned 0043608
2020-03-30 13:34 vmromanos Relationship added related to 0043608
2020-03-30 13:51 vmromanos Relationship replaced depends on 0043608
2020-03-30 14:02 vmromanos Note Added: 0118875
2020-03-30 14:07 vmromanos File Added: 43581_proposal.diff
2020-03-31 12:55 vmromanos Relationship replaced related to 0043608
2020-03-31 12:55 vmromanos Assigned To inigo_lerga => vmromanos
2020-03-31 13:00 vmromanos Note Edited: 0118875 View Revisions
2020-03-31 13:04 vmromanos Note Added: 0118890
2020-03-31 13:04 vmromanos Note Edited: 0118890 View Revisions
2020-03-31 13:05 vmromanos File Added: patch_to_force_trigger_exception.diff
2020-03-31 13:10 hgbot Checkin
2020-03-31 13:10 hgbot Note Added: 0118892
2020-03-31 13:10 hgbot Status scheduled => resolved
2020-03-31 13:10 hgbot Resolution open => fixed
2020-03-31 13:10 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ca7ef98a3db96f7ed94083b57a9efbcb31fdbfae [^]
2020-03-31 13:14 vmromanos Review Assigned To => dmiguelez


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker