Unexpected import behaviour when set the setting to view only for custom fields.
While creating the custom field there is a option
View Only? Is this field set by PHP code (via a custom hook). This field will not be updated by CiviCRM.
Even after selecting this option when we import a 'csv' containing one of the custom fields as its column, the value of the custom field is changed from the default value to the value mentioned in the 'csv'. Even when the custom field is not present in the csv, civicrm still assigns the field as empty but not the default value. This was replicated on various versions from 4.7 to 5.22.1. The error was also reported on https://civicrm.stackexchange.com/questions/34903/expected-import-behavior-when-setting-custom-field-to-view-only .