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-04-06 15:51
ReporterlbressanView Statuspublic 
Assigned Tovmromanos 
PrioritynormalResolutionfixedFixed in Version3.0PR20Q2
StatusclosedFix in branchFixed in SCM revision9586c212a90a
ProjectionnoneETAnoneTarget VersionPR20Q4
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 closedalostale failed process definition execution not shown in UI 

-  Notes
(0118875)
vmromanos (manager)
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 (manager)
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
---
(0118925)
dmiguelez (developer)
2020-04-02 15:40

Code Review + Testing Ok
(0118940)
hgbot (developer)
2020-04-06 09:25

Repository: erp/devel/pi
Changeset: 67445d6d353d73d35a60b50303d4840ee4fd7ceb
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Mon Apr 06 09:11:11 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/67445d6d353d73d35a60b50303d4840ee4fd7ceb [^]

Related to BUG-43581: Use OBMessageUtils.translateError()
This method provides better support for db related exceptions, so the error message is nicer

---
M src/org/openbravo/common/actionhandler/createlinesfromprocess/CreateInvoiceLinesFromHandler.java
---
(0118941)
hgbot (developer)
2020-04-06 09:25

Repository: erp/backports/3.0PR20Q2
Changeset: 9dc2aada8f02e43f975abea330de77c01c43c9f1
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Mon Apr 06 09:11:11 2020 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR20Q2/rev/9dc2aada8f02e43f975abea330de77c01c43c9f1 [^]

Related to BUG-43581: Use OBMessageUtils.translateError()
This method provides better support for db related exceptions, so the error message is nicer

---
M src/org/openbravo/common/actionhandler/createlinesfromprocess/CreateInvoiceLinesFromHandler.java
---
(0118980)
hgbot (developer)
2020-04-06 11:54

Repository: erp/devel/pi
Changeset: 9586c212a90a00eecfa52f9fe5d84cbc6c593496
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/9586c212a90a00eecfa52f9fe5d84cbc6c593496 [^]

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
---
(0118997)
cberner (developer)
2020-04-06 15:51

closed: wrongly reopened

- 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 Resolution time => 1586901600
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
2020-04-02 15:40 dmiguelez Note Added: 0118925
2020-04-02 15:40 dmiguelez Status resolved => closed
2020-04-02 15:40 dmiguelez Fixed in Version => 3.0PR20Q2
2020-04-06 09:25 hgbot Checkin
2020-04-06 09:25 hgbot Note Added: 0118940
2020-04-06 09:25 hgbot Checkin
2020-04-06 09:25 hgbot Note Added: 0118941
2020-04-06 11:54 hgbot Checkin
2020-04-06 11:54 hgbot Note Added: 0118980
2020-04-06 11:54 hgbot Status closed => resolved
2020-04-06 11:54 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/ca7ef98a3db96f7ed94083b57a9efbcb31fdbfae [^] => http://code.openbravo.com/erp/devel/pi/rev/9586c212a90a00eecfa52f9fe5d84cbc6c593496 [^]
2020-04-06 15:51 cberner Note Added: 0118997
2020-04-06 15:51 cberner Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker