(0093504)
|
hgbot
|
2017-01-13 11:52
|
|
Repository: erp/devel/pi
Changeset: ec94c6362d99d64951a185d7bf1f39171194af79
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Thu Jan 12 17:07:55 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ec94c6362d99d64951a185d7bf1f39171194af79 [^]
Fixed issue 34900: Email definition of the template was not correctly selected
If there was more than one email definition, one of them set as default, sometimes, when clicking the email button, the application was not choosing the correct email definition, which is the one with the "default" checkbox checked. It can happen also to have an email definition with the default checked but the language is different from the bussines partner's language, in this case if there exists another template which is not checked as default, but its language is the language of the business partner, this will have priority.
The problem here was that there was a piece of code which was using a Map, and it was overwritting the email definitions with the same language. This happened because the key used to store the email definitions in that map was the language it self. So, in the case of having, for example three email definitions with the same language and one of them set as default was failing because in the map was only stored the last one.
To fix this a new condition has been added. Now, if the email definition is marked as default, it is stored in the map. It does not matter to overwrite the other email definitions because only one can be the default and will be the one stored here. If the email definition is not marked as default instead, a comparation will be done to check if there already exists an email definition with the same language. If not, then, this email configuration will be added to the map. This is to prevent deleting the default configurations of a language.
---
M src/org/openbravo/erpCommon/utility/reporting/TemplateInfo.java
---
|
|