Skip to content

Commit

Permalink
Added an additional condition to check for mapping error on items imp…
Browse files Browse the repository at this point in the history
…ort disable (#605)

* Added an additional condition to check for mapping error on items import disable

* reused general_settings var
  • Loading branch information
Hrishabh17 authored May 9, 2024
1 parent 9f789b3 commit 7b81d71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/quickbooks_online/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ def __validate_expense_group(expense_group: ExpenseGroup, general_settings: Work

account = Mapping.objects.filter(source_type='CATEGORY', destination_type='ACCOUNT', source=category_attribute, workspace_id=expense_group.workspace_id).first()

if not general_settings.import_items:
account = Mapping.objects.filter(destination__display_name__iexact='account', source_type='CATEGORY', destination_type='ACCOUNT', source=category_attribute, workspace_id=expense_group.workspace_id).first()

if not account:
bulk_errors.append({'row': row, 'expense_group_id': expense_group.id, 'value': category, 'type': 'Category Mapping', 'message': 'Category Mapping not found'})

Expand Down

0 comments on commit 7b81d71

Please sign in to comment.