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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0022011
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2012-10-19 12:492012-10-31 13:30
ReporterXpand-ITView Statuspublic 
Assigned Tomtaal 
PriorityhighResolutionfixedFixed in Version3.0MP17
StatusclosedFix in branchFixed in SCM revision4ac6cc415fd4
ProjectionnoneETAnoneTarget Version
OSWindowsDatabasePostgreSQLJava version
OS Version7Database version8.4Ant version
Product Version3.0MP15SCM revision 
Review Assigned Todbaz
Web browserGoogle Chrome
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0022011: Can't change Invoice Lines in a Business Handler when the Invoice is changed

DescriptionI 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 ReproduceI attached my handler.

Changes made on the for in onUpdate (line 123) are not committed.
TagsNo tags attached.
Attached Files? file icon XphrPurchaseInvoiceHandler.java [^] (11,236 bytes) 2012-10-19 12:49

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0024287 closedplatform Event Handler runs 2 times when the change is made by another Event Handler 

-  Notes
(0053674)
hgbot (developer)
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 (developer)
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 (manager)
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 (developer)
2012-10-30 15:55

Reviewed
(0053836)
mtaal (manager)
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 (manager)
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.
(0053918)
hudsonbot (developer)
2012-10-31 13:30

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9e773cbcb723 [^]

Maturity status: Test
(0053920)
hudsonbot (developer)
2012-10-31 13:30

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9e773cbcb723 [^]

Maturity status: Test

- 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker