Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034439Openbravo ERPA. Platformpublic2016-11-09 09:442016-12-16 18:38
JONHM 
alostale 
immediateminoralways
closedfixed 
5
pi 
3.0PR17Q1 
caristu
Core
Production - QA Approved
2016-04-18
3.0PR16Q3
http://code.openbravo.com/erp/devel/pi/rev/82f27ac1b1497b3a82646b140ab1b6e048f2b766 [^]
No
0034439: can't add attachment to Invoices after print and attach
If we try to add an attachment in [Purchase Invoice] window when there is already an attachment included, it shows an error "freemarker.template.TemplateModelException".
In an instance with no modules in development

1) Open [Purchase Invoice] window and select some record
2) Press button "Print Record" and press "Yes" to attach the document
3) Expand attachments section and press "Add" to add a new document
---> It shows the error
Caused by: freemarker.template.TemplateModelException: get(title) failed on instance of org.openbravo.client.application.window.OBViewParameterHandler$OBViewParameter
  ...
Caused by: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
    at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167)
    at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
    at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
    at org.openbravo.model.ad.ui.Element_$$_javassist_10.getADElementTrlList(Element_$$_javassist_10.java)
    at org.openbravo.client.application.window.OBViewUtil.getParameterTitle(OBViewUtil.java:105)
    at org.openbravo.client.application.window.OBViewParameterHandler$OBViewParameter.getTitle(OBViewParameterHandler.java:241)
    ... 85 more

Note this happens when 2 is the first action in the current session regarding attachments for that window, in case add attachment is executed before, there is no issue.
Workaround: if in this situation, log out and log in to be able to add new attachments.
No tags attached.
depends on backport 00344543.0PR16Q4 closed alostale can't add attachment to Invoices after print and attach 
depends on backport 00344553.0PR16Q3.3 closed alostale can't add attachment to Invoices after print and attach 
caused by feature request 0029771 closed naiaramartinez different attachment method infrastructure 
png Screenshot from 2016-11-09 09:43:35.png (102,545) 2016-11-09 09:44
https://issues.openbravo.com/file_download.php?file_id=10025&type=bug
png
Issue History
2016-11-09 09:44JONHMNew Issue
2016-11-09 09:44JONHMAssigned To => platform
2016-11-09 09:44JONHMFile Added: Screenshot from 2016-11-09 09:43:35.png
2016-11-09 09:44JONHMModules => Core
2016-11-09 09:44JONHMResolution time => 1481497200
2016-11-09 09:44JONHMTriggers an Emergency Pack => No
2016-11-09 13:50jfrancesIssue Monitored: jfrances
2016-11-09 15:50alostaleSummaryException when adding an attachment in [Purchase Invoice] window => can't add attachment to Invoices after print and attach
2016-11-09 15:50alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13624#r13624
2016-11-09 15:51alostalePriorityhigh => immediate
2016-11-09 15:51alostaleSeveritymajor => minor
2016-11-09 15:51alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13625#r13625
2016-11-09 15:51alostaleProposed Solution updated
2016-11-09 15:52alostaleAssigned Toplatform => alostale
2016-11-09 15:53alostaleRelationship addedcaused by 0029771
2016-11-09 15:53alostaleRegression level => Production - QA Approved
2016-11-09 15:53alostaleRegression date => 2016-04-18
2016-11-09 15:53alostaleRegression introduced in release => 3.0PR16Q3
2016-11-09 15:53alostaleRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/82f27ac1b1497b3a82646b140ab1b6e048f2b766 [^]
2016-11-09 15:54alostaleStatusnew => scheduled
2016-11-09 16:11alostaleReview Assigned To => caristu
2016-11-09 16:23hgbotCheckin
2016-11-09 16:23hgbotNote Added: 0091293
2016-11-09 16:23hgbotStatusscheduled => resolved
2016-11-09 16:23hgbotResolutionopen => fixed
2016-11-09 16:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/43477851c1be9f9cd4af9036c4f5958466823904 [^]
2016-11-09 16:34hgbotCheckin
2016-11-09 16:34hgbotNote Added: 0091294
2016-11-09 16:34hgbotCheckin
2016-11-09 16:34hgbotNote Added: 0091295
2016-11-09 16:34hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/43477851c1be9f9cd4af9036c4f5958466823904 [^] => http://code.openbravo.com/erp/devel/pi/rev/c767cfbd08b601bc763a4b1e07eff9cbf6b7e7eb [^]
2016-11-10 09:42hgbotCheckin
2016-11-10 09:42hgbotNote Added: 0091314
2016-11-10 09:53caristuNote Added: 0091317
2016-11-10 09:53caristuStatusresolved => closed
2016-11-10 09:53caristuFixed in Version => 3.0PR17Q1
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092604
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092605
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092606
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092608

Notes
(0091293)
hgbot   
2016-11-09 16:23   
Repository: erp/devel/pi
Changeset: 43477851c1be9f9cd4af9036c4f5958466823904
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Nov 09 16:14:06 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/43477851c1be9f9cd4af9036c4f5958466823904 [^]

fixed bug 34439: can't add attachment to Invoices after print and attach

  When trying to add a new attachemnt just after attaching a printed document,
  a LazyInitializationException was thrown because ADCS cache parameter object
  was partially initialized. Programmatic attachement API initialized the parameters
  but not their translation lists.

  Fixed by initializating translation lists for parameters whenever it is added
  to ADCS.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
M src/org/openbravo/dal/security/AcctSchemaStructureProvider.java
M src/org/openbravo/erpCommon/utility/SystemInfo.java
---
(0091294)
hgbot   
2016-11-09 16:34   
Repository: erp/devel/pi
Changeset: ad142c9e8d5cace7482a982a8226a13f9a3b1cf5
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Nov 09 16:31:05 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ad142c9e8d5cace7482a982a8226a13f9a3b1cf5 [^]

related to bug 34439
Backed out changeset 43477851c1be: it contained unwanted changes

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
M src/org/openbravo/dal/security/AcctSchemaStructureProvider.java
M src/org/openbravo/erpCommon/utility/SystemInfo.java
---
(0091295)
hgbot   
2016-11-09 16:34   
Repository: erp/devel/pi
Changeset: c767cfbd08b601bc763a4b1e07eff9cbf6b7e7eb
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Nov 09 16:33:22 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c767cfbd08b601bc763a4b1e07eff9cbf6b7e7eb [^]

fixed bug 34439: can't add attachment to Invoices after print and attach

  When trying to add a new attachemnt just after attaching a printed document,
  a LazyInitializationException was thrown because ADCS cache parameter object
  was partially initialized. Programmatic attachement API initialized the parameters
  but not their translation lists.

  Fixed by initializating translation lists for parameters whenever it is added
  to ADCS.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
---
(0091314)
hgbot   
2016-11-10 09:42   
Repository: erp/devel/pi
Changeset: e11aa29da8c9cae5b51a20d4c6cd9c97185267a4
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Nov 10 09:42:06 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e11aa29da8c9cae5b51a20d4c6cd9c97185267a4 [^]

related to bug 34439: fixed the problem for sales windows

  Paramter translation for sales windows is obtained directly from parameter def
  instead of from element. This was not initialized in cached ADCS.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
---
(0091317)
caristu   
2016-11-10 09:53   
Code review + testing OK: working on both sales and purchase flows
(0092604)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092605)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092606)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092608)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test