diff --git a/fyle_accounting_mappings/models.py b/fyle_accounting_mappings/models.py index 6e4a28f..d8ed23c 100644 --- a/fyle_accounting_mappings/models.py +++ b/fyle_accounting_mappings/models.py @@ -424,27 +424,26 @@ def bulk_create_or_update_destination_attributes( ) ) else: - condition = ( - (attribute['value'] and primary_key_map[attribute['destination_id']]['value'] and - attribute['value'].lower() != primary_key_map[attribute['destination_id']]['value'].lower()) or - ('code' in attribute and attribute['code'] and - attribute['code'] != primary_key_map[attribute['destination_id']]['code']) - ) + condition = (attribute['value'] and primary_key_map[attribute['destination_id']]['value'] + and attribute['value'].lower() != primary_key_map[attribute['destination_id']]['value'].lower()) \ + or ('code' in attribute and attribute['code'] + and attribute['code'] != primary_key_map[attribute['destination_id']]['code']) + if attribute_disable_callback_path and is_import_to_fyle_enabled and condition: attributes_to_disable[attribute['destination_id']] = { - 'value': primary_key_map['destination_id']['value'], + 'value': primary_key_map[attribute['destination_id']]['value'], 'updated_value': attribute['value'], - 'code': primary_key_map['destination_id']['code'], + 'code': primary_key_map[attribute['destination_id']]['value'], 'updated_code': attribute['code'] } - condition = ( - (attribute['value'] != primary_key_map[attribute['destination_id']]['value']) - or ('detail' in attribute and attribute['detail'] != primary_key_map[attribute['destination_id']]['detail']) - or ('active' in attribute and attribute['active'] != primary_key_map[attribute['destination_id']]['active']) - or ('code' in attribute and attribute['code'] and - attribute['code'] != primary_key_map[attribute['destination_id']]['code']) - ) + condition = (attribute['value'] != primary_key_map[attribute['destination_id']]['value']) \ + or ('detail' in attribute and + attribute['detail'] != primary_key_map[attribute['destination_id']]['detail']) \ + or ('active' in attribute and + attribute['active'] != primary_key_map[attribute['destination_id']]['active']) \ + or ('code' in attribute and + attribute['code'] and attribute['code'] != primary_key_map[attribute['destination_id']]['code']) \ if update and condition: attributes_to_be_updated.append( diff --git a/setup.py b/setup.py index 601a42a..1cc0d20 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name='fyle-accounting-mappings', - version='1.36.2', + version='1.36.3', author='Shwetabh Kumar', author_email='shwetabh.kumar@fyle.in', description='Django application to store the fyle accounting mappings in a generic manner',