calculate true / false for fields

This commit is contained in:
Matthias 2021-10-23 23:40:57 +02:00
parent 1556663254
commit 8e6aaa89f9
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -389,16 +389,16 @@ class PartImport(FileManagementFormView):
default_location=optional_matches['default_location'], default_location=optional_matches['default_location'],
default_supplier=optional_matches['default_supplier'], default_supplier=optional_matches['default_supplier'],
variant_of=optional_matches['variant_of'], variant_of=optional_matches['variant_of'],
active=optional_matches['active'], active=str2bool(part_data.get('active', None)),
base_cost=optional_matches['base_cost'], base_cost=part_data.get('base_cost', None),
multiple=optional_matches['multiple'], multiple=part_data.get('multiple', None),
assembly=optional_matches['assembly'], assembly=str2bool(part_data.get('assembly', None)),
component=optional_matches['component'], component=str2bool(part_data.get('component', None)),
is_template=optional_matches['is_template'], is_template=str2bool(part_data.get('is_template', None)),
purchaseable=optional_matches['purchaseable'], purchaseable=str2bool(part_data.get('purchaseable', None)),
salable=optional_matches['salable'], salable=str2bool(part_data.get('salable', None)),
trackable=optional_matches['trackable'], trackable=str2bool(part_data.get('trackable', None)),
virtual=optional_matches['virtual'], virtual=str2bool(part_data.get('virtual', None)),
) )
try: try:
new_part.save() new_part.save()