Skip to content

Commit

Permalink
Fix attribute disable (#118)
Browse files Browse the repository at this point in the history
* fix: attribute disable only if import to fyle is true

* add check for code null

* add lower case check
  • Loading branch information
Hrishabh17 authored Sep 9, 2024
1 parent 49354ff commit 9916049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fyle_accounting_mappings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ def bulk_create_or_update_destination_attributes(
)
else:
if attribute_disable_callback_path and is_import_to_fyle_enabled and (
(attribute['value'] != primary_key_map[attribute['destination_id']]['value'])
or ('code' in attribute and attribute['code'] != primary_key_map[attribute['destination_id']]['code'])
(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'])
):
attributes_to_disable[attribute['destination_id']] = {
'value': primary_key_map[attribute['destination_id']]['value'],
Expand All @@ -408,7 +408,7 @@ def bulk_create_or_update_destination_attributes(
(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'] != primary_key_map[attribute['destination_id']]['code'])
or ('code' in attribute and attribute['code'] and attribute['code'] != primary_key_map[attribute['destination_id']]['code'])
):
attributes_to_be_updated.append(
DestinationAttribute(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='fyle-accounting-mappings',
version='1.34.3',
version='1.34.4',
author='Shwetabh Kumar',
author_email='shwetabh.kumar@fyle.in',
description='Django application to store the fyle accounting mappings in a generic manner',
Expand Down

0 comments on commit 9916049

Please sign in to comment.