Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034455Openbravo ERPA. Platformpublic2016-11-09 09:442016-11-10 10:01
JONHM 
alostale 
immediateminoralways
closedfixed 
5
pi 
3.0PR16Q3.33.0PR16Q3.3 
caristu
Core
Production - QA Approved
2016-04-18
3.0PR16Q3
http://code.openbravo.com/erp/devel/pi/rev/82f27ac1b1497b3a82646b140ab1b6e048f2b766 [^]
No
0034455: 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.
blocks defect 0034439 closed alostale can't add attachment to Invoices after print and attach 
Issue History
2016-11-09 15:54alostaleTypedefect => backport
2016-11-09 15:54alostaleTarget Version => 3.0PR16Q3.4
2016-11-09 16:16alostaleReview Assigned To => caristu
2016-11-09 16:18alostaleTarget Version3.0PR16Q3.4 => 3.0PR16Q3.3
2016-11-09 16:36hgbotCheckin
2016-11-09 16:36hgbotNote Added: 0091296
2016-11-09 16:36hgbotStatusscheduled => resolved
2016-11-09 16:36hgbotResolutionopen => fixed
2016-11-09 16:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q3.3/rev/e5553b0adc51db4aabf87c5eccc0665791e142a9 [^]
2016-11-10 09:43hgbotCheckin
2016-11-10 09:43hgbotNote Added: 0091315
2016-11-10 10:01caristuNote Added: 0091321
2016-11-10 10:01caristuStatusresolved => closed
2016-11-10 10:01caristuFixed in Version => 3.0PR16Q3.3

Notes
(0091296)
hgbot   
2016-11-09 16:36   
Repository: erp/backports/3.0PR16Q3.3
Changeset: e5553b0adc51db4aabf87c5eccc0665791e142a9
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Nov 09 16:33:22 2016 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR16Q3.3/rev/e5553b0adc51db4aabf87c5eccc0665791e142a9 [^]

fixed bug 34455: 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
---
(0091315)
hgbot   
2016-11-10 09:43   
Repository: erp/backports/3.0PR16Q3.3
Changeset: b95443070552dd5b9f56a9191b4992015603ff76
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Nov 10 09:42:06 2016 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR16Q3.3/rev/b95443070552dd5b9f56a9191b4992015603ff76 [^]

related to bug 34455: 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
---
(0091321)
caristu   
2016-11-10 10:01   
Code reviewed + tested OK: working on both sale and purchase flows