Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Resolve issue of failing tests #131

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions fyle_accounting_mappings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
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.36.2',
version='1.36.3',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Django application to store the fyle accounting mappings in a generic manner',
Expand Down
Loading