Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0022011 | Openbravo ERP | A. Platform | public | 2012-10-19 12:49 | 2012-10-31 13:30 |
|
Reporter | Xpand-IT | |
Assigned To | mtaal | |
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 10 | OS Version | 7 |
Product Version | 3.0MP15 | |
Target Version | | Fixed in Version | 3.0MP17 | |
Merge Request Status | |
Review Assigned To | dbaz |
OBNetwork customer | |
Web browser | Google Chrome |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0022011: Can't change Invoice Lines in a Business Handler when the Invoice is changed |
Description | I need to change all the lines when a field on the Invoice is changed.
In the business handler I can change the lines but they are not saved into the database.
If I add a line, it is saved but if I change an existing line it is not updated in the database. |
Steps To Reproduce | I attached my handler.
Changes made on the for in onUpdate (line 123) are not committed. |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | design defect | 0024287 | | closed | platform | Event Handler runs 2 times when the change is made by another Event Handler |
|
Attached Files | XphrPurchaseInvoiceHandler.java (11,236) 2012-10-19 12:49 https://issues.openbravo.com/file_download.php?file_id=5665&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2012-10-19 12:49 | Xpand-IT | New Issue | |
2012-10-19 12:49 | Xpand-IT | Assigned To | => marvintm |
2012-10-19 12:49 | Xpand-IT | File Added: XphrPurchaseInvoiceHandler.java | |
2012-10-19 12:49 | Xpand-IT | Web browser | => Google Chrome |
2012-10-19 12:49 | Xpand-IT | Modules | => Core |
2012-10-19 15:14 | shuehner | Web browser | Google Chrome => Google Chrome |
2012-10-19 15:14 | shuehner | Assigned To | marvintm => mtaal |
2012-10-19 15:14 | shuehner | Category | Y. DBSourceManager => A. Platform |
2012-10-25 09:41 | mtaal | Review Assigned To | => AugustoMauch |
2012-10-25 09:41 | mtaal | Web browser | Google Chrome => Google Chrome |
2012-10-25 09:44 | hgbot | Checkin | |
2012-10-25 09:44 | hgbot | Note Added: 0053674 | |
2012-10-25 09:44 | hgbot | Status | new => resolved |
2012-10-25 09:44 | hgbot | Resolution | open => fixed |
2012-10-25 09:44 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/4ac6cc415fd40f861a96377627669f3f4985cd31 [^] |
2012-10-25 10:51 | hgbot | Checkin | |
2012-10-25 10:51 | hgbot | Note Added: 0053679 | |
2012-10-30 09:10 | alostale | Review Assigned To | AugustoMauch => dbaz |
2012-10-30 13:43 | mtaal | Note Added: 0053823 | |
2012-10-30 15:55 | dbaz | Note Added: 0053834 | |
2012-10-30 15:55 | dbaz | Status | resolved => closed |
2012-10-30 15:55 | dbaz | Fixed in Version | => 3.0MP17 |
2012-10-30 16:18 | mtaal | Note Added: 0053836 | |
2012-10-30 16:18 | mtaal | Note Added: 0053837 | |
2012-10-31 13:30 | hudsonbot | Checkin | |
2012-10-31 13:30 | hudsonbot | Note Added: 0053918 | |
2012-10-31 13:30 | hudsonbot | Checkin | |
2012-10-31 13:30 | hudsonbot | Note Added: 0053920 | |
2015-01-27 10:25 | alostale | Relationship added | related to 0024287 |
Notes |
|
(0053674)
|
hgbot
|
2012-10-25 09:44
|
|
Repository: erp/devel/pi
Changeset: 4ac6cc415fd40f861a96377627669f3f4985cd31
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Oct 25 09:42:50 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4ac6cc415fd40f861a96377627669f3f4985cd31 [^]
Fixes issue 22011: Can't change Invoice Lines in a Business Handler when the Invoice is changed
Repeat flush until there are no changes anymore in the data, also improve error logging
when a batch update exception occurs
---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
---
|
|
|
(0053679)
|
hgbot
|
2012-10-25 10:51
|
|
Repository: erp/devel/pi
Changeset: a39ab20852a59118bf01221db38392997ad808a0
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Oct 25 10:50:59 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a39ab20852a59118bf01221db38392997ad808a0 [^]
Related to issue 22011: Can't change Invoice Lines in a Business Handler when the Invoice is changed
Also do the extra flushes in normal commits.
---
M src/org/openbravo/dal/core/SessionHandler.java
---
|
|
|
(0053823)
|
mtaal
|
2012-10-30 13:43
|
|
To reproduce this issue:
- go to the org.openbravo.client.application.event.SetDocumentNoHandler and add some code which changes the line of a sales order, for example increase the quantity.
- in the event handler you can get the sales order with event.getTargetInstance(), this is a sales order (or purchase order)
- from there you can get to the lines
- make sure that you don't get an error if the sales order header has no lines
compile and restart, create a new sales order header and a line, then go back and change the header, the line should be changed by the event handler and the change should be visible in the ui. |
|
|
(0053834)
|
dbaz
|
2012-10-30 15:55
|
|
|
|
(0053836)
|
mtaal
|
2012-10-30 16:18
|
|
Here a diff to reproduce the issue:
diff --git a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java
@@ -19,6 +19,7 @@
package org.openbravo.client.application.event;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@@ -79,6 +80,14 @@
Property docTypeTargetProperty = documentTypeTargetProperties[index];
Property processedProperty = processedProperties[index];
+ // test to set an arbitrary value for the order quantity
+ if (event.getTargetInstance() instanceof Order) {
+ final Order order = (Order) event.getTargetInstance();
+ if (order.getOrderLineList().size() > 0) {
+ order.getOrderLineList().get(0).setOrderedQuantity(new BigDecimal(83));
+ }
+ }
+
String documentNo = (String) event.getCurrentState(documentNoProperty);
boolean processed = false;
Object oProcessed = (processedProperty == null ? false : event |
|
|
(0053837)
|
mtaal
|
2012-10-30 16:18
|
|
The above diff should change the order quantity of the first sales order line to 83 when the sales order header is saved.
This should be visible in the ui. |
|
|
|
|
|
|
|