Openbravo Issue Tracking System - Modules
View Issue Details
0045291ModulesInitial data loadpublic2020-10-22 17:162020-10-29 16:11
sebastien_liron 
AtulOpenbravo 
immediatecriticalalways
closedfixed 
30Openbravo Appliance 14.04
 
 
Production - Confirmed Stable
0045291: import idl stock no longer works
We tested the import idl for stock and there is an issue with the tmp file creation.
Looking into the code, it seems that it is trying to write a tmp file already created, with no overwrite flags, so it fails.

I joined a fix, that I think should be taken, as it is a better and cleaner way to do the same thing ( and also it fixes the issue )
get a 20q2 version of openbravo
add the org.openbravo.idl module
compile, etc ...

try to import the joint file in the import for stock

the system should tell that the tmp file is already created.
see the diff joint.
No tags attached.
has duplicate defect 0045323 closed Triage Finance Not possible to import a file with more than 100 products 
? idlDiff (6,474) 2020-10-22 17:16
https://issues.openbravo.com/file_download.php?file_id=15041&type=bug
csv 20201005importSTK (1).csv (94,028) 2020-10-22 17:16
https://issues.openbravo.com/file_download.php?file_id=15042&type=bug
Issue History
2020-10-22 17:16sebastien_lironNew Issue
2020-10-22 17:16sebastien_lironAssigned To => Retail
2020-10-22 17:16sebastien_lironFile Added: idlDiff
2020-10-22 17:16sebastien_lironResolution time => 1604012400
2020-10-22 17:16sebastien_lironRegression level => Production - Confirmed Stable
2020-10-22 17:16sebastien_lironTriggers an Emergency Pack => No
2020-10-22 17:16sebastien_lironFile Added: 20201005importSTK (1).csv
2020-10-23 09:05marvintmProjectRetail Modules => Modules
2020-10-23 09:06marvintmCategoryRetail API => Initial data load
2020-10-23 09:06marvintmversionRR20Q2.2 =>
2020-10-23 09:06marvintmTarget VersionRR20Q2.3 =>
2020-10-23 09:06marvintmAssigned ToRetail => Triage Finance
2020-10-27 11:38inigo_lergaAssigned ToTriage Finance => inigo_lerga
2020-10-27 11:38inigo_lergaStatusnew => scheduled
2020-10-28 10:50AtulOpenbravoAssigned Toinigo_lerga => AtulOpenbravo
2020-10-29 04:00hgbotNote Added: 0123984
2020-10-29 10:07AtulOpenbravoNote Added: 0123994
2020-10-29 13:45dmiguelezRelationship addedhas duplicate 0045323
2020-10-29 16:11hgbotNote Added: 0124022
2020-10-29 16:11hgbotResolutionopen => fixed
2020-10-29 16:11hgbotStatusscheduled => closed
2020-10-29 16:11hgbotNote Added: 0124023
2020-10-29 16:11hgbotNote Added: 0124024

Notes
(0123984)
hgbot   
2020-10-29 04:00   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.idl/-/merge_requests/3 [^]
(0123994)
AtulOpenbravo   
2020-10-29 10:07   
Test Plan
- Install org.openbravo.idl module
- Login as F&B International Group Admin
- Using Enterprise module management, apply Initial Data Load dataset for F&B Espana organization
- Navigate to Import window, select file 20201005importSTK (1).csv (Attached file), Entity as Stock
- Run Validate process
- Realize that Error message related to org.apache.commons.io.FileExistsException disappears.

Note: There is another expected error about data not found for eg: Organization not found as the file content are not suitable for F&B International Group client.
(0124022)
hgbot   
2020-10-29 16:11   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.idl [^]
Changeset: 0d8ccebe15ffd15c5ff8adcdceef4ac24623104a
Author: atul.gaware <atul.gaware@openbravo.com>
Date: 2020-10-29T08:16:39+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.idl/-/commit/0d8ccebe15ffd15c5ff8adcdceef4ac24623104a [^]

Related To BUG-45291:Apply Java Formatting

---
M src/org/openbravo/idl/proc/IdlService.java
---
(0124023)
hgbot   
2020-10-29 16:11   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.idl [^]
Changeset: a61185a084b962ca3d6ecd6125f9411b688ef221
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2020-10-29T08:18:36+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.idl/-/commit/a61185a084b962ca3d6ecd6125f9411b688ef221 [^]

Fixes BUG-45291: import idl stock no longer works

** This problem is fixed commons-fileupload but it will
be available in its next release. Internally
FileUtils.moveFile was used so it was no
longer possible to overwrite an existing file in
DiskFileItem.write(File). This is fixed by deleting
the target file, if possible.
** Same solution is applied in IdlService by deleting
destination file if it exists.

---
M src/org/openbravo/idl/proc/IdlService.java
---
(0124024)
hgbot   
2020-10-29 16:11   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.idl/-/merge_requests/3 [^]