CSV Import fail on evaluate column mandatory logic

Description

When importing CSV files, the org.adempiere.impexp.GridTabCSVImporter.preprocessRow() submits the CSV row content to the field.isMandatory() function.

When this code is executed, field have the data of the field on current selected record in the UI, this way, all records isMandatory() will be submited to the logic against the current record and depending on the content of the record being inserted, it will return true for an empty field that should be returned false.

This checking can be safely removed from preprocessing, since when the importer fill the data later, it will be checked again with the correct context.

Environment

None

Attachments

1

Activity

Show:

Hiep Lq December 16, 2016 at 9:12 AM

can't update a tab have mandatory field
test case:
export data have mandatory field
+ change some value
+ empty mandatory field (so don't want import csv touch this field)

import at merger or update mode.

get error FillMandatory

Carlos Ruiz November 26, 2014 at 11:10 PM

Thanks , I changed a little your approach in order to still check field without checking context - I think this can be useful as column IsMandatory could be overwritten in field and field customization.

Claudemir Todo Bom October 27, 2014 at 12:13 PM

Fixed on this commit on my clone: http://goo.gl/AwBGWW

Already requested a pull.

Best regards,
Claudemir

Fixed

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged1h remaining

Components

Affects versions

Priority

Created October 26, 2014 at 2:49 PM
Updated February 1, 2017 at 6:30 AM
Resolved December 19, 2016 at 11:28 AM