Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0018189Openbravo ERPA. Platformpublic2011-08-04 07:372011-08-08 09:09
mtaal 
adrianromero 
immediatemajorhave not tried
closedfixed 
5
 
 
Core
No
0018189: After changing a product the sales order line can not be saved again
When changing the product the sales order line can not be saved. The eclipse console shows the error below. The error indicates that the creationDate field contains the productIdentifier.

a3196480 21004372 [http-8080-2] ERROR org.openbravo.service.json.DefaultJsonDataService - Exception when updating OrderLine(B24647BF9C4B461494D19F5126E6E958) (salesOrder: DF3D3B4F206B4396B6B4ED19444408C7, lineNo: 20, lineNetAmount: 16.08)
org.openbravo.base.exception.OBException: Exception when updating OrderLine(B24647BF9C4B461494D19F5126E6E958) (salesOrder: DF3D3B4F206B4396B6B4ED19444408C7, lineNo: 20, lineNetAmount: 16.08)
    at org.openbravo.service.json.JsonToDataConverter.setData(JsonToDataConverter.java:366)
    at org.openbravo.service.json.JsonToDataConverter.toBaseOBObject(JsonToDataConverter.java:328)
    at org.openbravo.service.json.DefaultJsonDataService.update(DefaultJsonDataService.java:394)
    at org.openbravo.service.datasource.DefaultDataSourceService.update(DefaultDataSourceService.java:152)
    at org.openbravo.service.datasource.DataSourceServlet.doPut(DataSourceServlet.java:619)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:640)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:429)
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:89)
    at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:65)
    at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:117)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.text.ParseException: Unparseable date: "Agua sin Gas 1L+0000"
    at java.text.DateFormat.parse(DateFormat.java:337)
    at org.openbravo.service.json.JsonToDataConverter.setData(JsonToDataConverter.java:357)
    ... 34 more
The error started occuring after this changeset (afaics):
https://code.openbravo.com/erp/devel/pi/rev/f8298218fb69 [^]

The problem is in this line in ob-selector-item.js:

              if (form.fields[j].columnName === outFields[i].fieldName) {

fields like creationDate and updated have a columnName which is an empty string, in this specific case the outField has a fieldName with an empty space also (the id field). So the condition is true and the value (which is not a date) is placed in the creationDate property.


Changing the condition to ignore empty columnName/fieldName is a solution, the columnName is empty because for audit fields this is not used (see the class: OBViewFormComponent.OBViewFieldAudit and specifically the getColumnName method).

I wonder though why the fieldName is empty, maybe also because in this case the outfield is the id
No tags attached.
related to defect 00171193.0MP3 closed iperdomo Out Fields in OBUISEL selectors not working 
Issue History
2011-08-04 07:37mtaalNew Issue
2011-08-04 07:37mtaalAssigned To => adrianromero
2011-08-04 07:37mtaalModules => Core
2011-08-04 09:27adrianromeroStatusnew => scheduled
2011-08-04 09:27adrianromerofix_in_branch => pi
2011-08-04 10:09hgbotCheckin
2011-08-04 10:09hgbotNote Added: 0039858
2011-08-04 10:09hgbotStatusscheduled => resolved
2011-08-04 10:09hgbotResolutionopen => fixed
2011-08-04 10:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c651835ae4cdc05d0438d834822130c6f2de69cf [^]
2011-08-04 10:10adrianromeroRelationship addedrelated to 0017119
2011-08-04 10:13adrianromeroNote Added: 0039859
2011-08-06 05:33hudsonbotCheckin
2011-08-06 05:33hudsonbotNote Added: 0039960
2011-08-08 09:09iperdomoNote Added: 0039979
2011-08-08 09:09iperdomoStatusresolved => closed

Notes
(0039858)
hgbot   
2011-08-04 10:09   
Repository: erp/devel/pi
Changeset: c651835ae4cdc05d0438d834822130c6f2de69cf
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Thu Aug 04 10:08:40 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c651835ae4cdc05d0438d834822130c6f2de69cf [^]

Fixes issue 0018189: After changing a product the sales order line can not be saved again
The change applied ignores columnnames empty because audit fields do not use the column name property and must be ignored as outfields
This change is related to the issue 17119

---
M modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
---
(0039859)
adrianromero   
2011-08-04 10:13   
* Testing the issue

** Go to a draft Sales order and try to modify an existing order line selecting a new product
** Save. It must succeed.

* Other areas affected

Because the change has been in selectors other windows may be affected. Verify also that this issue is also fixed for:

** Purchase and Sales invoices when modifying the product in lines,
** Purchase and Sales orders and invoices in header when modifying the business partner.
(0039960)
hudsonbot   
2011-08-06 05:33   
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/5744448753e7 [^]

Maturity status: Test
(0039979)
iperdomo   
2011-08-08 09:09   
Tested on pi @ rev cd93116382e9