Load boolean data from select_300 field while import

This commit is contained in:
PCoder 2022-01-13 09:46:04 +05:30
parent 4c328052da
commit 55ec614dd6
1 changed files with 3 additions and 0 deletions

View File

@ -452,6 +452,9 @@ def handle_object_dict(object_dict, model_name, debug=False):
for i in ['checked']:
if i in object_dict:
object_dict[i] = True if object_dict[i].lower().strip() == 'true' else False
for i in ['select_300']:
if i in object_dict:
object_dict[i] = True if object_dict[i].lower().strip() == 'x' else False
# area field can't be empty
if 'area' in object_dict:
if object_dict['area'] == '':